|
ken
Posts: 630
|
 |
« Reply #540 on: 24 Oct '08 - 10:06 » |
Quote
|
I'm trying the updated title from "BroadCast.Update" method when streaming WMA, but it's not working for me.
Streaming ShoutCast/Icecast the UpdateTitle works fine, but not in WMA.
Here is what I found out. If I listen (in Windows MediaPlayer) on my WMA stream (from your "Streaming" example) and update Title, it shows in MediaPlayer, but in the "big black window"?!.
But if I use the your "NetRadio" example I can't se e the Titleupdate. (title update works fine on IceCast/Shoutcast streams).
Any ideas Bernd?
/Ken
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #541 on: 24 Oct '08 - 14:19 » |
Quote
|
With WMA internet streams you can only change the "CAPTION" - which are shown in the "big black window" as you found out correctly. That's what the BroadCast.Update method is doing with a WMAcast instance.
So WMA broadcast streams doesn't contain regular Title updates like SHOUTcast or ICEcast. So in the NetRadio example I was only using standard META sync. But to also receive WMA meta syncs, you would need to use the BASS_SYNC_WMA_META.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #542 on: 24 Oct '08 - 16:00 » |
Quote
|
So in the NetRadio example I was only using standard META sync. But to also receive WMA meta syncs, you would need to use the BASS_SYNC_WMA_META.
Thanks! easyis was to do this: foreach (string child in _tagInfo.NativeTags) { if (child.StartsWith("CAPTION")) { Console.WriteLine("Title: " + child.Replace("CAPTION=", "")); break; } }
|
|
|
|
|
Logged
|
|
|
|
|
Nicolás
Guest
|
 |
« Reply #543 on: 27 Oct '08 - 17:07 » |
Quote
|
Hi, i need help..
My problem is that i need to play a different audio files (mp3) at the same time for different sound cards!!
A Friend tell me that i can fix my problem with the Bass.Net component, please give me some example or some idea..
Thanks!!
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #544 on: 28 Oct '08 - 08:13 » |
Quote
|
Please take a look to the BASS.NET documentation. See the "BASS_SetDevice" method in the Bass namespace this method also contains an example in C# and VB.Net
|
|
|
|
|
Logged
|
|
|
|
|
gbronzer
Posts: 1
|
 |
« Reply #545 on: 30 Oct '08 - 04:36 » |
Quote
|
Hi All, I'm just getting started with BASS.NET. I'm adapting an existing music player that picks songs on the fly from a database based on various criteria. I want to stream these to an ICECAST server over the net. However, I'm running into trouble tying the reading of the MP3 file to the lame encoder -> broadcast. I can get it to work, but it also plays the stream over the speakers. I gather it's related to using BASS_ChannelPlay, but I'm not sure if there's a simple way around this. Here's the gist of the code: miStream = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_MIXER_NONSTOP);
... code that ties miStream to a broadcast object via a lame encoder and icecast server
// Add song to the mixer int _stream = Bass.BASS_StreamCreateFile(msFilePath, 0L, 0L, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_DECODE);
if (!BassMix.BASS_Mixer_StreamAddChannel(miStream, _stream, BASSFlag.BASS_MIXER_DOWNMIX )) { MessageBox.Show("Couldn't add mixer channel."); Console.WriteLine(Bass.BASS_ErrorGetCode()); Stop(); return; }
Bass.BASS_ChannelPlay(miStream, false)
So is there a way to prevent this from playing over the speakers? Do I have to use GetChannelData instead? If so, does anyone have any good examples of feeding the data from a GetChannelData into a mixer channel for output? Don't you lose the AutoFree option in that case, and wouldn't that make it a lot harder to crossfade two files? Thanks
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #546 on: 30 Oct '08 - 08:26 » |
Quote
|
All you said is actually correct. You would have to make the mixer channel (miStream) a decoding one (add the BASS_DECODE flag when creating the stream). Instead of playing the mixer stream you would then need to call BASS_ChannelGetData periodically on the mixer. By doing so you also query the data from any sources added to the mixer (so there is no extra need to feed any data from the sources to the mixer). Decoding streams can not use the AUTOFREE flag, so yes, you would have to do that yourself.
Another more simple option might be to mute the output of the mixer channel via BASS_ChannelSetAttribute using the BASS_ATTRIB_VOL option. This way the mixer output will not be heard, but the broadcasting to the server will still use the original volume.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #547 on: 15 Nov '08 - 17:45 » |
Quote
|
I try to use EncoderNeroAAC to stream to ICEcast, but then starting by sound yout studdering !?, EncoderWinampAACplus works just fine I downloaded the latest "neroAacEnc.exe" (1.3.3.0) Should I set the NERO parameter different? EncoderNeroAAC _nero = new EncoderNeroAAC(_audioChannel); _nero.InputFile = null; _nero.OutputFile = null; _nero.NERO_Bitrate = int.Parse(cmbBitrates.Text); //tested with 32,64,96,128 _nero.NERO_UseCBR = false; _nero.NERO_2Pass = false; _nero.NERO_2PassPeriod = 0; _nero.NERO_UseCustomOptionsOnly = false;
if (_nero.EncoderExists) { _encoder = _nero; }
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #548 on: 15 Nov '08 - 18:15 » |
Quote
|
EncoderNeroAAC can not be use for streaming, as it doesn't support STDOUT. So EncoderWinampAACplus is the only encoder I know of which can be used for streaming.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #549 on: 16 Nov '08 - 02:30 » |
Quote
|
OK, thanks Bernd.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #550 on: 18 Nov '08 - 21:34 » |
Quote
|
Bernd,
Do you have any ideas or code example on how I can "send" audio with BASS over TCP/IP in my network, with low latency (don't wanna use Shoutcast or WMA streaming) ?
/Ken
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #551 on: 19 Nov '08 - 11:44 » |
Quote
|
No, sorry I don't have such.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #552 on: 19 Nov '08 - 21:44 » |
Quote
|
No, sorry I don't have such.
Bummer, I guess you hade answer for everything Bernd... 
|
|
|
|
|
Logged
|
|
|
|
|
anomaly
Posts: 3
|
 |
« Reply #553 on: 19 Nov '08 - 22:06 » |
Quote
|
HI ALL
I wonder WaveForm class supports a line drawing of an uncalibrated signal.
Thanks
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #554 on: 19 Nov '08 - 22:15 » |
Quote
|
@anomaly: Can you explain a little bit more of what you mean by "line drawing of an uncalibrated signal"?
@ken: The theory is pretty simply. Create a socket on the sending side and send the data (byte[]) via TCP/IP. This either from within a DSPPROC or directly from a decoding channel. On the receiver side do the same (but create a listener socket) and there you can create a PUSH stream via BASS_StreamCreate and call BASS_StreamPutData to put the byte[] received to the stream. That's it ;-)
|
|
|
|
|
Logged
|
|
|
|
|
anomaly
Posts: 3
|
 |
« Reply #555 on: 20 Nov '08 - 00:27 » |
Quote
|
@anomaly: Can you explain a little bit more of what you mean by "line drawing of an uncalibrated signal"?
Sorry for my English ... I'm curious, whether does the WaveForm class draw waves accurately in the same way as Sony Sound Forge(or some other audio editor) does?
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #556 on: 20 Nov '08 - 08:23 » |
Quote
|
Being honest, I have no clue how they (the others) draw the wave form ;-) But as far as I can tell (as I coded the wave form) it is as accurate as possible.
However, I guess the audio signal is always 'calibrated' - as you have fixed and defined scales and values, e.g. using floating point channels: 0=-indev.dB, 1=0dB etc. So the respective sample data values are defined and such calibrated (if I get your term right).
The wave form implementation shows all values in the range between silent (-indevdB) and max (0dB).
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #557 on: 20 Nov '08 - 09:28 » |
Quote
|
@ken: The theory is pretty simply. Create a socket on the sending side and send the data (byte[]) via TCP/IP. This either from within a DSPPROC or directly from a decoding channel. On the receiver side do the same (but create a listener socket) and there you can create a PUSH stream via BASS_StreamCreate and call BASS_StreamPutData to put the byte[] received to the stream. That's it ;-)
Yes, that I get, but handeling lost data ands so on... I did find a library for audio over IP, and what I understand built on BASS. Unfortently is a ActiveX component. http://lakeofsoft.com/vcx/index.html
|
|
|
|
|
Logged
|
|
|
|
|
anomaly
Posts: 3
|
 |
« Reply #558 on: 22 Nov '08 - 12:37 » |
Quote
|
Using Sony Sound Forge software 8.0 ...  Using BASS.NET API 2.4.2.0 ...  Here's my code: public void GetWaveForm(string path) { TAG_INFO tag = BassTags.BASS_TAG_GetFromFile(path); // render a wave form WF = new WaveForm(path, MyWaveFormCallback, this); WF.CallbackFrequency = 500; WF.ColorBackground = Color.Black; WF.FrameResolution = (float)(tag.duration/Width/1000*50); switch(tag.channelinfo.chans) { case 1: WF.DrawWaveForm = WaveForm.WAVEFORMDRAWTYPE.Mono; break; case 2: WF.DrawWaveForm = WaveForm.WAVEFORMDRAWTYPE.Stereo; break; } WF.DrawEnvelope = false; WF.RenderStart(true, BASSFlag.BASS_SAMPLE_MONO); }
private void MyWaveFormCallback(int framesDone, int framesTotal, TimeSpan elapsedTime, bool finished) { DrawWave(); if (finished) { //MessageBox.Show(elapsedTime.ToString()); } }
private void DrawWave() { if (WF != null) this.BackgroundImage = WF.CreateBitmap(this.Width, this.Height, -1, -1, false); else this.BackgroundImage = null; } What do I do wrong?  Sorry for my stupid questions.
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #559 on: 22 Nov '08 - 17:21 » |
Quote
|
The BASS.NET waveform shown in your picture seems to be a 'Mono' one. Mono is calculated internally by: (left+right)/2 So I don't know how Sound Forge calculates the image? I aslo don't know, if your source file is a stereo or a mono stream? So have you compared the Sound Forge one with the BASS.NET drawing type "Stereo" resp. "Dual Mono", as it seams, that Sound Forge draws left and right overlayed, which is more like "Dual Mono"?!
|
|
|
|
|
Logged
|
|
|
|
|