22 May '13 - 21:16 *
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: Noise outputs to Speaker when closing app with wasapi channel source  (Read 306 times)
h1
Posts: 4


« on: 20 Aug '12 - 11:07 »
Reply with quoteQuote

Hello

I have coded a bass/wasapi/enc app which uses a wasapi loop back channel (speaker) as an input to be streamed via an encoder and not decoded & played on this computer.

If the speaker output source app (eg. winamp, windows media player etc...)  is closed while playing audio there is a constant noise (like static) from the speaker.

To stop the noise I either re-start the audio source app or close the bass/wasapi/enc app (which is not the best solution).

The issue does not occur if the waspai loop back channel is a digital speaker output rather than a std speaker output.

Any idea why this would occur and whether there's a resolution?

Thanks
Kym
Logged
Ian @ un4seen
Administrator
Posts: 15269


« Reply #1 on: 20 Aug '12 - 14:37 »
Reply with quoteQuote

I seem to recall someone else having this issue a while ago. I think the solution was to keep the device active, eg. by playing silence. For example, you could create and play a silent sample like this...

BASS_Init(...); // initialize the output device of interest
HSAMPLE sample=BASS_SampleCreate(44100, 44100, 1, 1, BASS_SAMPLE_LOOP); // create a sample
BYTE data[44100]={0}; // a 44100 byte block of silence
BASS_SampleSetData(sample, data); // set the sample data
BASS_ChannelPlay(BASS_SampleGetChannel(sample, 0), 0); // play the sample

Please see the documentation for details on the aforementioned functions.
Logged
h1
Posts: 4


« Reply #2 on: 21 Aug '12 - 11:32 »
Reply with quoteQuote

Spot on ... that works great  Smiley

Thanks Ian

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

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines