Author Topic: SHOUTcast Real Example !!!  (Read 803 times)

bll1401

  • Posts: 19
Re: SHOUTcast Real Example !!!
« Reply #25 on: 24 Sep '17 - 17:25 »
IS there an example of recording in C# !!   :-[

Chris

  • Posts: 1810
Re: SHOUTcast Real Example !!!
« Reply #26 on: 24 Sep '17 - 17:51 »
In the Bass.net Example Folder(Streaming)  is a complete example for recording/encoding/Shoutcast/Icecast
« Last Edit: 26 Sep '17 - 21:50 by Chris »

bll1401

  • Posts: 19
Re: SHOUTcast Real Example !!!
« Reply #27 on: 26 Sep '17 - 19:33 »
Tried that before didn't work :(

see what I have in my recordBtn :

            EncoderMP3 Enc = new EncoderMP3(_recHandle);    // this handle is the same one I used above to stream   
            Enc.InputFile = null;
            Enc.OutputFile = Application.StartupPath + "\\test.mp3";
            Enc.CMDLN_Bitrate = 48;

            Enc.Start(null, IntPtr.Zero, false);

radio42

  • Posts: 4576
Re: SHOUTcast Real Example !!!
« Reply #28 on: 27 Sep '17 - 07:17 »
Your code snippet doesn't look right (but it would even be better, if you post your entire code and tell us exactly where something goes wrong).
See here for details: http://www.bass.radio42.com/help/html/53d3394f-6acf-c797-c21e-700ce5204826.htm
Code: [Select]
EncoderLAME lame = new EncoderLAME(_recHandle);
lame.InputFile = null;    //STDIN
lame.OutputFile = "test.mp3";
lame.LAME_Bitrate = (int)EncoderLAME.BITRATE.kbps_64;
lame.LAME_Mode = EncoderLAME.LAMEMode.Default;
lame.LAME_Quality = EncoderLAME.LAMEQuality.Quality;
lame.Start(null, IntPtr.Zero, false);

bll1401

  • Posts: 19
Re: SHOUTcast Real Example !!!
« Reply #29 on: 30 Sep '17 - 07:16 »
Thanks it worked NOW !

But I wanted to stop recording after I disconnect from the shoutcast

I tried this and called from another button :

       private void stopRecord()
        { 
            EncoderLAME lame = new EncoderLAME(_recHandle);
            lame.Stop();
        }

it didn't work it crashed the mp3 file right after :(

when I stop the whole project during the streaming I can play the mp3 file well :)


so it's a problem about closing the recording file (mp3)  so what should I do to stop recording the file once I disconnect from the shoutcast ( stop streaming )


Thanks so much for your help

Bill

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: SHOUTcast Real Example !!!
« Reply #30 on: 2 Oct '17 - 17:08 »
       private void stopRecord()
        { 
            EncoderLAME lame = new EncoderLAME(_recHandle);
            lame.Stop();
        }

You should use the same EncoderLAME class instance in the Stop call that you used in the Start call, ie. don't use "new EncoderLAME" again there.

bll1401

  • Posts: 19
Re: SHOUTcast Real Example !!!
« Reply #31 on: 4 Oct '17 - 08:20 »
Yeah that what I was trying to do

but show me how please to do so    I am not expert in C#

----

I tried many times with error

radio42

  • Posts: 4576
Re: SHOUTcast Real Example !!!
« Reply #32 on: 4 Oct '17 - 09:35 »
You must make the lame variable public.
E.g.:
Code: [Select]
private EncoderLAME _lame = null;
...
private void StartRecord()
{
    StopRecord();

    _lame = new EncoderLAME(_recHandle);
    ...
}

private void StopRecord()
{
    if (_lame != null)
    {
        _lame.Stop();
    }
}

Please don't get me wrong, but it seems, that your are not really familiar with C# nor even coding at all?
If so, note, that this forum here can not really teach you the basic coding principles. Coding audio applications is a bit advanced...

bll1401

  • Posts: 19
Re: SHOUTcast Real Example !!!
« Reply #33 on: 12 Oct '17 - 15:58 »
Yeah worked EXCELLENT :)

Thanks so much :)  ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D ;D