Author Topic: Features request (monitor / predecode)  (Read 4175 times)

kchabot

  • Guest
Features request (monitor / predecode)
« on: 25 May '03 - 15:54 »
Hi,

I am trying to develop an freeware BPM/AtomixMp3 alternative
using the BASS library. For the moment I stopped my development because I bass does not provide the following features (or I don't know how to maybee).

1) There should be the possibility to set/output a channel to a speaker at runtime (for example, per channel). It should also be possible to add a channel that uses the EXACT audio stream of a stream that runs 100% synch. The duplicate channels should run independant. (Playback speed change not required here). The use of two seperate audio streams is flawed since it is impossible to get them playing at exact speed and at exact position. There is always a difference (of +/- 50ms).

2) There should be a possibility of retreiving decoded audio output (such as when using the channelGetData), but independant of the outputBufferSize. For example, while buffersize is 100ms, get the decoded stream yet-to-come for 5000ms). This should come from the stream, not to the channel and should also be available, even if the stream or channel is pauzed.

3) Also a minor note is that the BASS library can not change it's position, volume and effect properties witout a very small click of 1/5ms space. This should also not be. Sliding the value does not help. (You have to thrust be on this, it has nothing to do with my soundcard, buffersize or cpu speed).

For the rest, I thank you for this great library.
Kind Regards...

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Features request (monitor / predecode)
« Reply #1 on: 26 May '03 - 16:10 »
Quote
1) There should be the possibility to set/output a channel to a speaker at runtime (for example, per channel).

You can assign channels to specific speakers. (BASS_SPEAKER flags)

Quote
It should also be possible to add a channel that uses the EXACT audio stream of a stream that runs 100% synch. The duplicate channels should run independant. (Playback speed change not required here). The use of two seperate audio streams is flawed since it is impossible to get them playing at exact speed and at exact position. There is always a difference (of +/- 50ms).

Try linking the channels. (BASS_ChannelSetLink)

Quote
2) There should be a possibility of retreiving decoded audio output (such as when using the channelGetData), but independant of the outputBufferSize. For example, while buffersize is 100ms, get the decoded stream yet-to-come for 5000ms). This should come from the stream, not to the channel and should also be available, even if the stream or channel is pauzed.

You should use a separate decoding channel for this. (BASS_STREAM_DECODE flag)

Quote
3) Also a minor note is that the BASS library can not change it's position, volume and effect properties witout a very small click of 1/5ms space. This should also not be.

Any sudden large change in level will naturally cause a click in the sound. Sliding (in the case of the volume) should not cause a click (except maybe if it's a very short slide period).

kchabot

  • Guest
Re: Features request (monitor / predecode)
« Reply #2 on: 26 May '03 - 21:14 »
"You can assign channels to specific speakers. (BASS_SPEAKER flags)"

You can't assign them at runtime

"Try linking the channels. (BASS_ChannelSetLink)"
This will only link play states and not positions.
It does not play synched this way

"You should use a separate decoding channel for this. (BASS_STREAM_DECODE flag)"
Ok, I could try this some how... However, this recuires 2 times the same stream beiing decoded. And it must also be synched, which will result in more problems...

"Any sudden large change in level will naturally cause a click in the sound. Sliding (in the case of the volume) should not cause a click (except maybe if it's a very short slide period)."

I understand, but there is still a click if you move it slowly. Even then, if the value is changed from 90 to 50 in about 30 steps. I recorded the audio in duplex mode while sliding and when you change the value you can see a small space between the wavforms...

I understand it might be unpleasant to fix these problems or requests I made, but if you could put it on your to do list... There is no rush, no rush at all. I'm simply making the program in my spare time for fun so...
However, I think if you add the features it would improve the power of this library.

Kind regards...

Ian @ un4seen

  • Administrator
  • Posts: 26028
Re: Features request (monitor / predecode)
« Reply #3 on: 26 May '03 - 23:50 »
Quote
"You can assign channels to specific speakers. (BASS_SPEAKER flags)"

You can't assign them at runtime

Sure you can. Or do you mean change them? If so, you'll have to recreate the channel with the new speaker flag. Creating streams is generally very fast (if you don't use the BASS_MP3_SETPOS flag), so this shouldn't have any great hit on performance.

Quote
"Try linking the channels. (BASS_ChannelSetLink)"
This will only link play states and not positions.
It does not play synched this way

Assuming both channels start at the same position, the positions should stay synced. If you wanted to change the position, you'ld first stop the channels, then seek on both of them, and start them playing again... again, they're starting together at the same position, so should stay synced.

Quote
"You should use a separate decoding channel for this. (BASS_STREAM_DECODE flag)"
Ok, I could try this some how... However, this recuires 2 times the same stream beiing decoded. And it must also be synched, which will result in more problems...

Yes, but your original request was not feasible. In your example, what would BASS do with the extra 4900ms of decoded data that doesn't fit in the channel's buffer? It'd be lost (not played).

If you're never looking beyond 5 seconds ahead, then you could try simply increasing the buffer length. (BASS_SetBufferLength)

What I'm saying is that, with a little thought, there are ways in which you can achieve each of your requests :)

Quote
"Any sudden large change in level will naturally cause a click in the sound. Sliding (in the case of the volume) should not cause a click (except maybe if it's a very short slide period)."

I understand, but there is still a click if you move it slowly. Even then, if the value is changed from 90 to 50 in about 30 steps. I recorded the audio in duplex mode while sliding and when you change the value you can see a small space between the wavforms...

That's strange. What soundcard and Windows/DirectX version are you using, and have you checked for updated drivers?

Also, if you run the precompiled CONTEST.EXE example, does it click during the fade-out at the end?

bigjim

  • Posts: 232
Re: Features request (monitor / predecode)
« Reply #4 on: 26 May '03 - 23:50 »
Hi-
I cant give you the code as Ive just reinstalled my os and not delphi/vb etc yet, but this should give you the idea how to change speaker assignments at runtime.

All you have to do is code for each possible outcome. ie-
a setup dialog

user sets a global variable
deck1_assignment = 1 // 1=front 2=rear


If deck1_assignment = 1 then BASS_StreamCreateFile(xxx,xxx,xxx,FRONT_SPEAKER)
If deck1_assignment = 2 then BASS_StreamCreateFile(xxx,xxx,xxx,REAR_SPEAKER)

It is possible- if you still cant see what I'm getting at reply in this post and hopefully I'll post some code shortly.
;)


Kevin Chabot

  • Guest
Re: Features request (monitor / predecode)
« Reply #5 on: 27 May '03 - 23:23 »
I have tried what you proposed already...

About the bufferlength, I did use 5000ms at first, but then it takes 5sec to perform a fade or pitch,... ofcourse so that is not possible.

Again, I tried dubble buffers again, but i can't seem to get it exact in sync. Anyway, i'll keep trying...