Namespace: Un4seen.Bass.Misc
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Parameters
- encoder
- Type: Un4seen.Bass.MiscIBaseEncoder
The output encoder instance to be used.
Exception | Condition |
---|---|
ArgumentException | Invalid EncoderType (only OGG, MP3, AAC or FLAC_OGG is supported)! |
Please note, that you need an appropriate encoder for ICEcast streaming. For MP3 streaming we recommend using the latest stable version of LAME (see EncoderLAME). For OGG streaming we recommend using the latest stable version of oggenc2 (see EncoderOGG).
When streaming in AACplus format an external encoder is needed as well, which accepts pcm data from STDIN and is able to send it's encoded data to STDOUT. As of today the only 'free' AACplus encoders comes with Winamp - you might use the 'enc_aacPlus.exe' (see EncoderWinampAACplus) or 'fhgaacenc.exe' (see EncoderFHGAACplus) with it.
Also take care of all neccessary patent and license issues when streaming or broadcasting!
Use the UseBASS property to decide, whether you want to use the BASS build-in streaming support (default) or if you want to use the BASS.NET internal implementation. The major difference is, that the BASS.NET implementation allows you to use SendData(IntPtr, Int32) manually.
// create an encoder instance EncoderLAME lame = new EncoderLAME(_recHandle); lame.LAME_Bitrate = (int)EncoderLAME.BITRATE.kbps_56; lame.LAME_Mode = EncoderLAME.LAMEMode.Mono; lame.LAME_TargetSampleRate = (int)EncoderLAME.SAMPLERATE.Hz_22050; lame.LAME_Quality = EncoderLAME.LAMEQuality.Quality; // now create the ICEcast instance using LAME ICEcast icecast = new ICEcast(lame); icecast.ServerAddress = "http://serveraddress.com"; icecast.ServerPort = 8000; icecast.Password = "password"; icecast.Mountpoint = "/mystream"; ...