jeudi 19 novembre 2015

AS3 RTMP broadcasting feed doesn't include audio

I'm developing a little ActionScript3 app that broadcast the camera and microphone of the user to a RTMP feed.

The video is working great but the microphone doesn't work. Playing the RTMP feed with VLC indicate that there is not audio feed at all, only the video feed.

The server (Wowza) is currently used with others streams so the problem is not coming from here. There was also a flash broadcast app used on the server before that was working fine.

Here's the code:

// Connection code

// Code run after connected event on connection

var h264:H264VideoStreamSettings = new H264VideoStreamSettings();
h264.setProfileLevel(H264Profile.BASELINE, H264Level.LEVEL_3_1);

outStream = new NetStream(connection);
outStream.videoStreamSettings = h264;

// Camera code

microphone = Microphone.getEnhancedMicrophone(0);

if( microphone )
{
    var options:MicrophoneEnhancedOptions = new MicrophoneEnhancedOptions();
    options.mode = MicrophoneEnhancedMode.FULL_DUPLEX;
    microphone.enhancedOptions = options;
    microphone.setLoopBack(false);
    microphone.setUseEchoSuppression(true);
    microphone.setSilenceLevel(0);
    microphone.codec = SoundCodec.SPEEX;
    microphone.encodeQuality = 10;
    microphone.rate = 16;
    microphone.gain = 75;

    outStream.attachAudio(microphone);
}

outStream.publish( streamKey );

Aucun commentaire:

Enregistrer un commentaire