Author Topic: BASSCD (Bass_ChannelGetdata) Feature Request  (Read 1794 times)

VorTechS

  • Posts: 263
I've been asked to implement Exact Audio copy into my application and wondered about the feasability of re-reading channel data for accuracy, particularly from CD source.

Specifically can we have an override for BASS_ChannelGetData that also specifies a start point, so instead of:

                    'Fill as much of the buffer with the relevant data
                    ReDim Preserve buf(Un4seen.Bass.Bass.BASS_ChannelGetData(CDTrackHandle, buf(0), 20000) - 1)

we can have something like:

                    'Fill as much of the buffer with the relevant data
                    ReDim Preserve buf(Un4seen.Bass.Bass.BASS_ChannelGetData(CDTrackHandle, buf(0), LastBufferPoint, 20000) - 1)

Essentially I want to re-read the buffer <x> number of times, into a buffer array each time.
Then get the most accurate result I'll build a single buffer of the most accurate bits from all of the buffers.

Is this doable?

TIA

Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASSCD (Bass_ChannelGetdata) Feature Request
« Reply #1 on: 12 Jul '07 - 17:16 »
Essentially I want to re-read the buffer <x> number of times, into a buffer array each time.
Then get the most accurate result I'll build a single buffer of the most accurate bits from all of the buffers.

Is this doable?

Could you not do that by simply rewinding (BASS_ChannelSetPosition) and rereading? :)

Your seek positions (and buffer sizes) should be on CD audio frame boundaries, which are 2352 bytes long. To avoid cached data (in the drive), I guess you should read fairly large chunks, or maybe even read the entire track through.

VorTechS

  • Posts: 263
Re: BASSCD (Bass_ChannelGetdata) Feature Request
« Reply #2 on: 8 Oct '07 - 10:25 »
Thanks for the seek info!  I'm actually starting the implementation of this now.

I guess it would be possible to clear the cache via a hardware command....?

So perhaps I can change my request to have BASS expose a function so that I can do this? :)


Ian @ un4seen

  • Administrator
  • Posts: 20400
Re: BASSCD (Bass_ChannelGetdata) Feature Request
« Reply #3 on: 8 Oct '07 - 18:39 »
As far as I can see, there is no command to clear the read cache. I think the only way to avoid reading cached data is probably to read in chunks that are larger than the cache (the size can be checked via BASS_CD_GetInfo).

There is a mechanism for disabling the read cache, but I'm not sure how many drives support it. If you'd like to give that a go, here's an experimental update to try...

   www.un4seen.com/stuff/basscd.dll

It includes this new function to enable/disable the read cache (write caching is unaffected)...

Code: [Select]
BOOL WINAPI BASS_CD_SetCache(DWORD drive, BOOL enable);

VorTechS

  • Posts: 263
Re: BASSCD (Bass_ChannelGetdata) Feature Request
« Reply #4 on: 9 Oct '07 - 07:20 »
Thanks Ian, I'll give that a go and see what the function returns. :)