24 May '13 - 01:31 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: how to remove vocal in DSP  (Read 1944 times)
beem
Posts: 36


« on: 20 Dec '03 - 11:06 »
Reply with quoteQuote

I want to play mp3 and remove vocal

how do ?
Logged
Peter_Hebels
Posts: 119


« Reply #1 on: 20 Dec '03 - 13:02 »
Reply with quoteQuote

The following code was posted by Svante in thread:
http://www.un4seen.com/forum/?board=1;action=display;threadid=1948

' 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 » Logged
beem
Posts: 36


« Reply #2 on: 20 Dec '03 - 13:58 »
Reply with quoteQuote

' ONLY FOR 32-BIT STEREO STREAMS!!!

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

by the way I  use delphi
Logged
Al Meyer
Posts: 20


« Reply #3 on: 22 Dec '03 - 12:03 »
Reply with quoteQuote

Hi. Is there a delphi version of this code?
TIA
Logged
Irrational86
Posts: 960


« Reply #4 on: 22 Dec '03 - 13:57 »
Reply with quoteQuote

Yes there is, here you go....for best handling, set Floating-Point DSPs (so that it will work for all files)
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 » Logged
Filipe84
Posts: 35


« Reply #5 on: 14 Jun '10 - 15:07 »
Reply with quoteQuote

Hi,

  someone have this sample code in c# ??

Thanxxx
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines