Author Topic: how to remove vocal in DSP  (Read 5169 times)

beem

  • Posts: 36
how to remove vocal in DSP
« on: 20 Dec '03 - 11:06 »
I want to play mp3 and remove vocal

how do ?

Peter_Hebels

  • Posts: 119
Re:how to remove vocal in DSP
« Reply #1 on: 20 Dec '03 - 13:02 »
The following code was posted by Svante in thread:
https://www.un4seen.com/forum/?board=1;action=display;threadid=1948

Code: [Select]
' ONLY FOR 32-BIT STEREO STREAMS!!!

' Call with  'Pointer Variable' = BASS_ChannelSetDSP('CHANNEL', AddressOf SBVocalCut, 0)
' Remove with BASS_ChannelRemoveDSP('CHANNEL', 'Pointer Variable')

Public Sub SBVocalCut32(ByVal handle As Long, ByVal channel As Long, ByVal buffer As Long, ByVal length As Long, ByVal user As Long)
Dim SBVocCut32Buf() As Single, SBVocCut32CSample As Long
Dim SBVocCut32DM As Single
ReDim SBVocCut32Buf(length / 2) As Single

Call CopyMemory(SBVocCut32Buf(0), ByVal buffer, length)
   
    For SBVocCut32CSample = 0 To length / 2 - 1 Step 2
        SBVocCut32DM = ((0 - SBVocCut32Buf(SBVocCut32CSample)) + SBVocCut32Buf(SBVocCut32CSample + 1)) / 2
        SBVocCut32Buf(SBVocCut32CSample) = SBVocCut32DM
        SBVocCut32Buf(SBVocCut32CSample + 1) = SBVocCut32DM
    Next SBVocCut32CSample
   

Call CopyMemory(ByVal buffer, SBVocCut32Buf(0), length)
End Sub

It's for Visual Basic but should not be to difficult to translate to oher languages.
« Last Edit: 20 Dec '03 - 13:04 by Peter_Hebels »

beem

  • Posts: 36
Re:how to remove vocal in DSP
« Reply #2 on: 20 Dec '03 - 13:58 »
' ONLY FOR 32-BIT STEREO STREAMS!!!

but I want to work for 16-bit and 32 bit

by the way I  use delphi

Al Meyer

  • Posts: 20
Re:how to remove vocal in DSP
« Reply #3 on: 22 Dec '03 - 12:03 »
Hi. Is there a delphi version of this code?
TIA

Irrational86

  • Posts: 960
Re:how to remove vocal in DSP
« Reply #4 on: 22 Dec '03 - 13:57 »
Yes there is, here you go....for best handling, set Floating-Point DSPs (so that it will work for all files)
Code: [Select]
procedure SBVocalCut32(handle: DWORD; channel: DWORD; buffer: Pointer; length: DWORD; user: DWORD); stdcall;
var
  i: DWORD;
  dmch: Single;
  lch, rch: PSingle;
begin
  i := 0;
  lch := buffer;
  rch := buffer;
  Inc(rch);

  while (i < length) do
  begin
    dmch := ((0 - lch^) + rch^) / 2;

    lch^ := dmch;
    rch^ := dmch;

    Inc(lch, 2);
    Inc(rch, 2);
    Inc(i, SizeOf(Single) * 2);
  end;
end;
« Last Edit: 22 Dec '03 - 13:58 by XMinioNX »

Filipe84

  • Posts: 35
Re: how to remove vocal in DSP
« Reply #5 on: 14 Jun '10 - 15:07 »
Hi,

  someone have this sample code in c# ??

Thanxxx