20 Jun '13 - 14:34 *
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: Can I modify an internet audio stream and listen to it on the same sound card?  (Read 445 times)
Hamilton
Posts: 7


« on: 7 Apr '12 - 15:39 »
Reply with quoteQuote

Hi. I'm seeking to do real time filtering of an incoming music stream (e.g. Spotify) before playing it to a pair of audio output channels, or maybe up to 6 output channels. This could allow me, for example, to perform real time EQ, or create an active crossover for multiple hi fi speaker drive units. I'd like to do it on a sample-by-sample basis, using my own filtering code, rather than BASS's inbuilt effects, streams etc.

I have an Audigy 2 ZS card that can, in theory, provide up to 8 output channels. I've experimented and found that I can generate individual sine waves on the 3 output sockets using BASS ASIO, by simply stuffing floats into the callback buffer in the callback routine. So far so good.

What I'm not at all sure about, is how to receive incoming data from the internet stream. I'm naively assuming I can receive the incoming audio on the Audigy's 'What-U-Hear' (digital) mixer input. Will the stereo data appear on the first couple of ASIO input channels I create, if the 'What-U-Hear' box is ticked on the Windows audio recording mixer? Or must I run a (non-ASIO?) call to set which input source I require?

I'm also assuming that Spotify (or any other program) will want to 'take over' the two main sound card outputs..? However, if I run a BASS ASIO program while Spotify is running, it doesn't tell me that any outputs are unavailable even though music is playing on the main stereo outputs (and all 8 can be joined successfully using BASS_ASIO_ChannelJoin). What mechanism, if any, 'maps' the channel numbers to the jack sockets on the back of the sound card?

I'm pretty sure I could do this with two sound cards (one for input, one for output), but they would have to be synchronised to the same sample clock, I think.

(A related question, what is the relationship between the BASS library and the BASS ASIO library? Will I need any non-ASIO BASS calls to make this scheme work?)

Has anyone else tried to do this sort of thing?

Many thanks for any help with this.
Logged
Hamilton
Posts: 7


« Reply #1 on: 8 Apr '12 - 09:24 »
Reply with quoteQuote

Here's what I've found so far:

In the ASIO device listing using BASS_ASIO_GetDeviceInfo, I get two possible devices:
0: Device:Creative ASIO Driver:C:\WINDOWS\SYSTEM32\CTASIO.DLL
1: Device:SB Audigy 2 ZS ASIO 24/96 [DCC0] Driver:C:\WINDOWS\SYSTEM32\CTASIO.DLL

If I select the former, I apparently have up 22 inputs and 20 outputs available, and with the latter 6 and 8. This link decribes how they are mapped in the former case: http://forums.creative.com/showthread.php?t=279862

It's not entirely clear to me whether I can achieve what I want to with this system. From the link above (and assuming that all channel numbers are +1 from how they are enumerated in BASS):

• ASIO inputs 3 and 4 (Mix Pre EQ) This records a simple downmix of all audio coming out of the sound card, without EAX effects, regardless of what speaker mode you are in. (This isn’t a physical input);
!! My NOTE: (this functions as "What U Hear")

• ASIO inputs 5 and 6 are "Mix (Post EQ Front L/R)", and this, too, isn’t a physical input. Using compatible software, this allows the signal to be fed via the onboard Creative DSP Spatializer and main EQ, making it possible to record a "virtual" 6.1 mix for playback over a two-channel headphone or loudspeaker system. What happens is that the DSP Spatializer processes the individual surround components in a way that recreates the illusion of 6.1 surround-sound from a two-speaker system. Very neat! What’s more, you can hear the effect when replayed over any two-speaker system or headphones, and so, if you use this effect on one of your own tracks, anyone can play it back using regular stereo playback equipment. Note, however, that, if you’re in 6.1 speaker mode and record this output, no signal will be output from the rear, centre or subwoofer channels. What you hear will be the virtual surround-sound coming from a single stereo output. If you want to hear these elements separately, choose "Mix (Pre EQ)";

I'm guessing that one of these two options might be what I want, but it's not clear to me whether I can also be generating audio on the surround channels at the same time.

A problem my intial experiments have shown up is that I don't get 'digital silence' when no stream is playing with either of these two options. Maybe the line in and mic inputs are also unavoidably 'in the mix' ..? Can I turn them off? I have also seen this when using lesser sound cards which, apparently only have an analogue mixer, but I thought that the Audigy 2 was all digital.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines