Author Topic: Synced audio  (Read 4340 times)

hukka

  • Posts: 77
Synced audio
« on: 18 May '03 - 12:30 »
I want to implement a "preview channel" feature to my little DJ'ing software, so that for example the Line Out on my soundcard would be for master output and Rear Out would be for headphone previewing. The user could toggle if a song would be heard on the master out, preview channel or both.
What's the best way to output audio so that the outputs are synchronized as good as possible?

fredvs

  • Posts: 325
Re: Synced audio
« Reply #1 on: 18 May '03 - 14:59 »
Hi
1- Create 2 streams from the same file, one with front flag, one with rear flag.
2- Play both stream.
3 - Zis done....

hukka

  • Posts: 77
Re: Synced audio
« Reply #2 on: 18 May '03 - 15:53 »

Quote

Hi
1- Create 2 streams from the same file, one with front flag, one with rear flag.
2- Play both stream.
3 - Zis done....


If I simply do that, they aren't in perfect sync. The other stream will be behind just a little, but enough to be annoying...

fredvs

  • Posts: 325
Re: Synced audio
« Reply #3 on: 18 May '03 - 16:07 »
Hi

Use then getposition of the first stream and setposition for second stream just before playing second stream...

Ian @ un4seen

  • Administrator
  • Posts: 26222
Re: Synced audio
« Reply #4 on: 18 May '03 - 18:16 »
Try linking the channels (BASS_ChannelSetLink) - that can be used to play/stop multiple channels simultaneously. For seeking (which I guess you'll need), you'll have to stop them, seek both to the position you want, then start them playing again.

hukka

  • Posts: 77
Re: Synced audio
« Reply #5 on: 18 May '03 - 18:26 »

Quote

Try linking the channels (BASS_ChannelSetLink) - that can be used to play/stop multiple channels simultaneously. For seeking (which I guess you'll need), you'll have to stop them, seek both to the position you want, then start them playing again.


That's exactly what I did just five minutes ago, then I read your reply. Yes, that works, thanks Ian :o)