Author Topic: CD Ripping Speed  (Read 208 times)

findjammer

  • Posts: 15
CD Ripping Speed
« on: 14 Nov '17 - 22:41 »
Hi,

I've searched the docs and forums for more clues / info but I can't seem to find the answer/solution.  I can't seem to get a CD to encode a stream at higher than real-time speeds.

I'm executing the following code (C#):

BASS_CD_INFO info = new BASS_CD_INFO();

BassCd.BASS_CD_GetInfo(0, info);

BassCd.BASS_CD_SetInterface(BASSCDInterface.BASS_CD_IF_AUTO);
BassCd.BASS_CD_SetSpeed(0, info.maxspeed);

var cdStream = BassCd.BASS_CD_StreamCreateFile(cdTrackImportViewModel.InputTrackPath, BASSFlag.BASS_STREAM_DECODE);

var encodeStream = BassEnc.BASS_Encode_Start(cdStream, Path.Combine(cdDefinition.OutputPath, cdTrackImportViewModel.OutputFileName), BASSEncode.BASS_ENCODE_PCM | BASSEncode.BASS_ENCODE_AUTOFREE, null, IntPtr.Zero);

while (Bass.BASS_ChannelIsActive(cdStream) == BASSActive.BASS_ACTIVE_PLAYING &&
      BassEnc.BASS_Encode_IsActive(cdStream) == BASSActive.BASS_ACTIVE_PLAYING)
{
   var buff = new byte[1048576];
   Bass.BASS_ChannelGetData(cdStream, buff, 1048576);
}

Bass.BASS_StreamFree(cdStream);
Bass.BASS_StreamFree(encodeStream);

I'm wondering how to correctly configuring the drive/streams to get the speeds up.  Maybe I'm doing something else wrong that is effecting the drive or streams behaviour.

Thanks,

Ian @ un4seen

  • Administrator
  • Posts: 20425
Re: CD Ripping Speed
« Reply #1 on: 15 Nov '17 - 16:41 »
You could try using -1 (instead of "info.maxspeed") in the BASS_CD_SetSpeed call. You could also give this latest BASSCD build a try:

   www.un4seen.com/stuff/basscd.zip

It adds a BASS_CONFIG_CD_READ option to set (via BASS_SetConfig) the read block size in frames (the default is 16), which you could try playing around with to see if it makes a difference. That should be set before the BASS_CD_StreamCreate call. If you are able to read from the drive more quickly with any other software, you could check what block size it is using (hopefully somewhere in its config).

findjammer

  • Posts: 15
Re: CD Ripping Speed
« Reply #2 on: 15 Nov '17 - 18:21 »
Hi Ian,

I had already tried the call passing -1 but I'll try your other suggestions and the new lib.

Thank you chap.

j

findjammer

  • Posts: 15
Re: CD Ripping Speed
« Reply #3 on: 16 Nov '17 - 20:25 »
Hmm, I can't seem to find BASS_CONFIG_CD_READ in Bass.Net.  Maybe it's a little behind the latest version?

radio42

  • Posts: 4576
Re: CD Ripping Speed
« Reply #4 on: 17 Nov '17 - 07:51 »
It's the first time I hear about this new option - so how could I already have implemented that?
But if you consider this 'behind', then yes, I am 'behind' ;-)

normcook04

  • Posts: 26
Re: CD Ripping Speed
« Reply #5 on: 17 Nov '17 - 13:28 »
Radio, see Ian's post above
The constant BASS_CONFIG_CD_READ is undefined.

radio42

  • Posts: 4576
Re: CD Ripping Speed
« Reply #6 on: 17 Nov '17 - 14:17 »
You can always work with so far undefined constants, as in Bass.Net i do use enums for this.
So simply specify:
Code: [Select]
(BASS_CONFIG_CD_READ)0x10205This will cast the numeric integer value to the existing enum type (even if the effective enum doesn't yet contain this value).

Ian @ un4seen

  • Administrator
  • Posts: 20425
Re: CD Ripping Speed
« Reply #7 on: 17 Nov '17 - 15:55 »
Hmm, I can't seem to find BASS_CONFIG_CD_READ in Bass.Net.  Maybe it's a little behind the latest version?

The BASS_CONFIG_CD_READ option isn't in the current BASSCD release version (on the BASS webpage), but you can copy its definition from the BASSCD.H file included with the update above.