|
ken
Posts: 630
|
 |
« Reply #700 on: 3 Jan '10 - 12:45 » |
Quote
|
Hi Bernd, and Happy New Year! Some ASIO stuff, #1. I have some in and out devices, and want to "route" input audio to an out channel (and use volume on the input, maybe some DSP) I add my input like this: _asioIn[InputIndex] = new BassAsioHandler(true, ASIOdev, ASIOchannel * 2, 2, BASSASIOFormat.BASS_ASIO_FORMAT_16BIT, 44100); //Use 16 BIT otherwise the compressor don't work! _asioIn[InputIndex].Start(0);
And I can encode to MP3 with using the "_asioIn[InputIndex].InputChannel". But I cant add "_asioIn[InputIndex].InputChannel" to a BassMixer, to play it "out", just get noice. How do I solv that? Sure I can use: _asioIn[InputIndex].SetFullDuplex(0, BASSFlag.BASS_STREAM_DECODE, true); and add "_asioIn[InputIndex].OutputChannel;" to the mixer. But that will make me set ASIO buffer higher, else I get crackle sound, and my CPU load 10% (othervise 1-2%) AND the inputaddio is deleyed 5-10 seconds befor I hear it on output. #2. I have notised if I have BASSFlag.BASS_STREAM_AUTOFREE in BASS_Mixer_StreamAddChannel, I get an "poping" sound in the playbak when the sound I play is ended. Now I use and it sound ok, just want to make sure it ok code: BassMix.BASS_Mixer_ChannelRemove(_channel1); BassMix.BASS_Mixer_StreamAddChannel(_Mixer, _channel1, BASSFlag.BASS_MIXER_DOWNMIX | BASSFlag.BASS_MIXER_BUFFER)
|
|
|
|
« Last Edit: 3 Jan '10 - 19:49 by ken »
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #701 on: 4 Jan '10 - 08:29 » |
Quote
|
Yes, you can not use the "BassAsioHandler.InputChannel" as a source to a mixer channel, as this is an internal dummy stream.
So you should/must actually call "BassAsioHandler.SetFullDuplex" and then use the "BassAsioHandler.OutputChannel" to add that to the mixer channel. Note, that you should only set the 'buffered' parameter of the SetFullDuplex function to true, if your mixer channel is played out via BASS/DirectSound. If your mixer is also a decoding channel being played via ASIO, then you should set the 'buffered' parameter to false - this wouldn't add any latency then.
The popping sound at the end when adding the AUTOFREE parameter sounds strange and doesn't seem to be related to the BassAsioHandler. I am not sure what might cause this - but may be it is related to the MIXER_BUFFER flag?
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #702 on: 4 Jan '10 - 10:08 » |
Quote
|
Thanks Bernd, My problem with the 5-10 second delay, was that I did not add channel to mixer at the same time as I create the asioIn Handler and SetFullDuplex. I simply solved that with: BassMix.BASS_Mixer_ChannelSetPosition(_inputChannel, 0); Another question, I want to fade out a channel the remove it from the mixer. I can du it like this but it's not a pretty solution, do you have any other suggestions? Bass.BASS_ChannelSlideAttribute(_inputChannel, BASSAttribute.BASS_ATTRIB_VOL, 0, 1000); Thread.Sleep(1000); BassMix.BASS_Mixer_ChannelRemove(_inputChannel);
/Ken
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #703 on: 7 Jan '10 - 23:30 » |
Quote
|
You might use -1 as the fading param in BASS_ChannelSlideAttribute - this will stop the channel when fading is done automatically - when the AUTOFREE flag was given when adding it to the mixer it will automatically be removed from the mixer.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #704 on: 13 Jan '10 - 09:09 » |
Quote
|
The popping sound at the end when adding the AUTOFREE parameter sounds strange and doesn't seem to be related to the BassAsioHandler. I am not sure what might cause this - but may be it is related to the MIXER_BUFFER flag?
Bernd, I stil have a serious problem geting a "poping" sound when the mixer is removed (by autofree or by my code at sync event) This is how I play the audio: 1. Create sound and add to mixer. The sound is paused to get better starttimes when playing over network. BassMix.BASS_Mixer_ChannelRemove(_channel1); // + some BASS_Mixer_ChannelRemoveSync Bass.BASS_StreamFree(_channel1);
_channel1 = Bass.BASS_StreamCreateFile(songcard.Filename, 0L, 0L, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT); BassMix.BASS_Mixer_StreamAddChannel(_Mixer1, _channel1, BASSFlag.BASS_MIXER_PAUSE | BASSFlag.BASS_STREAM_AUTOFREE);
2. Start play (release pause) Bass.BASS_ChannelSetAttribute(_channel1, BASSAttribute.BASS_ATTRIB_VOL, _VolumeP1); BassMix.BASS_Mixer_ChannelFlags(_channel1, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_MIXER_PAUSE); Bass.BASS_ChannelSetPosition(_channel1, StartPos);
And when I have tree "channels" that I alter, each load and starts like above. If I remove BASS_STREAM_AUTOFREE, the "poping" is gone, but then I can use "BassMix.BASS_Mixer_ChannelIsActive" to get status... Mixer created like this _mixer = BassMix.BASS_Mixer_StreamCreate(44100, 2, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_MIXER_NONSTOP);
U use ASIO, and if I set buffesize to max (4096) then the "popping" is gone even with "AutoFree", but I want low latency (256-512) for input latency reasons. /Ken
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #705 on: 14 Jan '10 - 15:32 » |
Quote
|
That really sounds strange to me as I cannot reproduce the issue you are heaving have you tried if the problem is due to the NONSTOP mixer flag?
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #706 on: 14 Jan '10 - 16:26 » |
Quote
|
That really sounds strange to me as I cannot reproduce the issue you are heaving have you tried if the problem is due to the NONSTOP mixer flag?
My app does other things at the same time as I get "sync" from a stream that ends, but that is done in separate threads, and there is no poping when not relaseing a mixerchannel (manual or by autofree). I get less "poping" if I don't use BASS_MIXER_NONSTOP. I use BASS_MIXER_NONSTOP so the mixer don't stop woring, sice I add and remove streams and sometimes don't have any stream for the moment. Maybe I don't need that? Is there any whay to set a higher buffer on a "streamchannel" without seting higher buffer on BassAsioHandler?
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #707 on: 14 Jan '10 - 16:44 » |
Quote
|
Bernd, I start playback like this today: Bass.BASS_ChannelSetAttribute(_channel1, BASSAttribute.BASS_ATTRIB_VOL, _VolumeP1); BassMix.BASS_Mixer_ChannelFlags(_channel1, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_MIXER_PAUSE); Bass.BASS_ChannelSetPosition(_channel1, startCue.TotalSeconds);
But If U use only this, I get no popoing even at 128 in ASIO buffer BassMix.BASS_Mixer_ChannelFlags(_channel1, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_MIXER_PAUSE);
But I need to set start position and volume, and some times I need fade in. Then I do like this: Bass.BASS_ChannelSetAttribute(_channel1, BASSAttribute.BASS_ATTRIB_VOL, 0); BassMix.BASS_Mixer_ChannelFlags(_channel1, BASSFlag.BASS_DEFAULT, BASSFlag.BASS_MIXER_PAUSE); Bass.BASS_ChannelSlideAttribute(_channel1, BASSAttribute.BASS_ATTRIB_VOL, _VolumeP1, (int)fadeInDuration.TotalMilliseconds); Bass.BASS_ChannelSetPosition(_channel1, startCue.TotalSeconds);
|
|
|
|
|
Logged
|
|
|
|
|
leo2010
Posts: 21
|
 |
« Reply #708 on: 26 Jan '10 - 22:30 » |
Quote
|
I am trying to use bass_dshow plugin from bass.net API. I could not understand why Bass.BASS_StreamCreateFile gives me an invalid handle with error code BASS_ERROR_HANDLE. Whenever I use .AVI file I get invalid handle, when i use other audio only formats, I get a valid handle. It works in VB6 envrionment even with .avi files.
I am using BASS.NET API and I am loading the bass_dshow plugin. I am passing the name of the file to the Bass.BASS_StreamCreateFile function. Any ideas on what am i Missing ?
here is the code I am using could you let me know if i am missing something
if (!Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, this.Handle)) { MessageBox.Show(this, "Bass_Init error!"); this.Close(); return; } int status= Bass.BASS_PluginLoad("BASS_DSHOW.dll"); int stream= Bass.BASS_StreamCreateFile(filename, 0, 0, 0);
The stream returns 0 and the error code is BASS_ERROR_HANDLE. However i get valid stream if I use audio files. Is this the right way to load a bass_dshow plugin int status= Bass.BASS_PluginLoad("BASS_DSHOW.dll");
How come Bass.BASS_StreamCreateFile works fine in VB6 environment, but fails in .net environment when i load .avi files ?
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #709 on: 27 Jan '10 - 08:33 » |
Quote
|
See your other post: BASS_DSHOW isn't a real BASS plugin at the moment. And such BASS_PluginLoad("BASS_DSHOW.dll") might actually fail.
Also note, that BASS.NET currently doesn't offer an API for DSHOW, as the state of the add-on is still pretty unstable and the API is changing very often. But I guess it will be added very soon, whenever DSHOW becomes more mature.
|
|
|
|
|
Logged
|
|
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #711 on: 3 Feb '10 - 22:22 » |
Quote
|
As far as I can see, today it is not possible to differentiate between AAC and AAC+.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #712 on: 3 Feb '10 - 22:27 » |
Quote
|
As far as I can see, today it is not possible to differentiate between AAC and AAC+.
Yes I see that now on my IceCast server. "Content Type: audio/aacp" no + ... Thanks!
|
|
|
|
|
Logged
|
|
|
|
|
renzska
Posts: 22
|
 |
« Reply #713 on: 5 Feb '10 - 22:42 » |
Quote
|
I noticed that Winamp v5.571 has a new version of the enc_aacplus.dll. This does not seem to work with the current version of BASS. I also noticed that the aacPlusCLI codeplex project has a new version: http://aacpluscli.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=37963 which states the following: Just a new build recompiled to match libraries included in Winamp 5.571. Any chance we can get an updated enc_aacPlus.zip that works with this new version? Thanks, John 17.08.2009: Version 2.4.5.0 is out! BASSenc: added support for v2.4.4.2 BASS_APE: added support for v2.4.0.4 BASS_MPC: added support for v2.4.1.0 BASSFLAC: added support for v2.4.0.3 BASS_AC3: added support for v2.4.0.2 BASS_ALAC: added support for v2.4.0.5 General: - some smaller Bug-Fixes - WaveWriter: new WriteNoConvert method added - WaveForm: some internal optimizations - Utils: DetectNextLevel method added and DetectCuePoints optimized Breaking Changes: - EncoderWinampAACplus changed to support Winamp 5.33 or above enc_aacPlus.dll! Note: The AACPlus_* properties have been changed and you MUST use it with the latest Winamp enc_aacPlus.dll!BASS.NET: Full Install: www.un4seen.com/filez/4/Bass24.Net.zipLib only: www.un4seen.com/filez/4/Bass24.Net_update.zipIf you are using EncoderWinampAACplus make sure to also update: www.un4seen.com/filez/4/enc_aacPlus.zip
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #714 on: 6 Feb '10 - 10:18 » |
Quote
|
Here is a new version which should incorporate all the latest changes_ - using the latest Winamp 5.57 "enc_aacPlus.dll" and "nscrt.dll" - using libmp4v2.dll [from Winamp folder] for mp4/m4a writing instead of mp4box Get it here: www.un4seen.com/filez/4/enc_aacPlus.zipLet me know, if you fing anything
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #715 on: 9 Feb '10 - 13:39 » |
Quote
|
09.02.2010: Version 2.4.6.2 is out! BASS: added support for v2.4.5.11 BASSmidi: added support for v2.4.5.0 BASSenc: added support for v2.4.6.2 BASSmix: added support for v2.4.3.2 General: - AddOn.Tags: bug-fix when reading ID3v2 unsychronization flags - Misc.BaseEncoder: new 'NoLimit' flag added Full Install: www.un4seen.com/filez/4/Bass24.Net.zipLib only: www.un4seen.com/filez/4/Bass24.Net_update.zipAlso note, that a new version of enc_aacPlus.exe is available: - using the latest Winamp 5.57 "enc_aacPlus.dll" and "nscrt.dll" - using libmp4v2.dll [from Winamp folder] for mp4/m4a writing instead of mp4box Get it here: www.un4seen.com/filez/4/enc_aacPlus.zip
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #716 on: 18 Feb '10 - 09:23 » |
Quote
|
How should I set EncoderWinampAACplus for best sound on low bitrate. I do like this now (have latest version of all DLL, and winamp dlls) EncoderWinampAACplus aac = new EncoderWinampAACplus(_audioChannel); aac.InputFile = null; aac.OutputFile = null; aac.AACPlus_Bitrate = 32; aac.AACPlus_High = false; aac.AACPlus_HE = true; aac.AACPlus_EnableParametricStereo = true; if (aac.EncoderExists) { _encoder = aac; ICEcast icecast = new ICEcast(_encoder, true); ... ...
}
It sound good in WinAmp, but I can't play the stream in iPhone (type url in web browser that launch mediaplayer) Now here is a stream in AAC 32k that sound even better in WinAmp, and that I can play in iPhone: http://vis.media-ice.musicradio.com/CapitalV1.m3uThis stream also use IceCast, same cersion as I. Any ideas?
|
|
|
|
|
Logged
|
|
|
|
|
radio42
Posts: 4012
|
 |
« Reply #717 on: 18 Feb '10 - 09:36 » |
Quote
|
I can't give you any special advices, but I guess you might also try the AACPlus_High setting and just play with the different settings until you find your best option.
|
|
|
|
|
Logged
|
|
|
|
|
ken
Posts: 630
|
 |
« Reply #718 on: 18 Feb '10 - 12:16 » |
Quote
|
I can't give you any special advices, but I guess you might also try the AACPlus_High setting and just play with the different settings until you find your best option.
I have tried most combinations and those settings sounds best in WinAmp. Do you know any other ACC+ encoder (lik stand alone software) that I can test, just for see where in the chain the problem is. /Ken
|
|
|
|
|
Logged
|
|
|
|
|
inagy
Posts: 9
|
 |
« Reply #719 on: 18 Feb '10 - 12:22 » |
Quote
|
Hi! I have some Linux+Mono specific questions, but looks like there's noone in the Linux version's topic who can answer me. So i though about copying it here too. I hope it's not a problem. I've started testing BASS on Linux using Mono and the BASS.NET assembly. Reading through the topic i could manage to play a simple mp3 file. Now trying to use bassenc to stream something to my IceCast server. I've tried the native cast example, everything was okay with it. From my project i try to feed the LAME encoder from a simple mp3 stream channel. Everything works fine, until i try to call the CastInit method. I get this error: Unhandled Exception: System.DllNotFoundException: bassenc.so at (wrapper managed-to-native) Un4seen.Bass.AddOn.Enc.BassEnc:BASS_Encode_CastInit (int,string,string,string,string,string,string,string,string,int,bool) at testbass.MainClass.Main (System.String[] args) [0x00000] As you can see, i've mapped the bassenc.dll to bassenc.so in the config file of Bass.Net.dll, the same way as i did with bass.so. I'm using the 64bit version of Ubuntu 9.10, i've placed the libraries into the lib64 folder, and after it didn't solve my problem, i've placed it near my mono exe file and launched mono with the LD_LIBRARY_PATH=".\" export. That also not worked. I've seen that someone here managed to use bassenc on Linux. Could you help me what did i do wrong? Or is it a bug with the Bass.Net and x64 combination of bassenc?  Thanks!
|
|
|
|
|
Logged
|
|
|
|
|