19 Jun '13 - 15:52 *
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: Newbee needs C# example for CD Read and Rip  (Read 413 times)
DutchJohn
Posts: 8


« on: 18 Jun '12 - 22:31 »
Reply with quoteQuote

Hi All,

only just started with BASS (dotnet) and so far I'm well impressed!
Also the examples provided with the installation are very good starting points. There is only one I miss (if my eyes don't deceive me...): a simple example in c# to read and rip a cd (preferable using lame).
Over the last two days I have been plowing through the forum but can't find anything.

Can anyone provide such an example?
Logged
Ian @ un4seen
Administrator
Posts: 15363


« Reply #1 on: 20 Jun '12 - 14:04 »
Reply with quoteQuote

I'm not a .Net user myself, so I'm afraid I can't advise on the specifics of that, but the basic ripping/encoding process will look something like this...

HSTREAM decoder=BASS_CD_StreamCreate(drive, track, BASS_STREAM_DECODE); // create a "decoding channel" from a CD track
BASS_Encode_Start(decoder, "lame - output.mp3", BASS_ENCODE_AUTOFREE, NULL, NULL); // set an MP3 encoder (LAME) on it
while (BASS_ChannelIsActive(decoder) && BASS_Encode_IsActive(decoder)) { // the decoder and encoder are still going
char buf [20000]; // processing buffer
BASS_ChannelGetData(decoder, buf, sizeof(buf)); // process some data
}
BASS_StreamFree(decoder); // free the decoder (and encoder due to AUTOFREE)

Please see the documentation for details on the aforementioned functions.
Logged
DutchJohn
Posts: 8


« Reply #2 on: 20 Jun '12 - 16:20 »
Reply with quoteQuote

Hi Ian,

thanks! This is just the simple start I need. I can work it out from here.


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

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines