Skip to main content
amsicora
Participant
Jun 11, 2009 11:25 AM UTC
Question

Problem listening audio Nellymoser 8k in Linux and Mac OS

I have a  audio streaming problem, is there anyone that can help me ?

If I publish using an Adobe Flash Media Encoder 2.5 or a normal client a netstream with codec NellyMoser at 8Khz, the audio stream is incomprehensible for a MAC OS or a Linux Adobe Player.

Steps to reproduce:
1. Create a new Actionscript Project in Flex Builder, for example: AdobeBug.
2. Start a Flash Media Server 3.5 in localhost (rtmp://localhost/live).
3. Insert the following code in the Default Application file: AdobeBug.as

package {

import flash.display.Sprite;

import flash.events.NetStatusEvent;

import flash.media.Microphone;

import flash.net.NetConnection;

import flash.net.NetStream;


public class AdobeBug extends Sprite

{

     public var nc:NetConnection;

     public var ns:NetStream;

     public var mic:Microphone;

     public function AdobeBug()

     {

          nc = new NetConnection();

          nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

          nc.connect("rtmp://localhost/live");

          nc.client = new CustomClient();

     }

    

     private function netStatusHandler(event:NetStatusEvent):void

     {

          switch (event.info.code)

          {

           case "NetConnection.Connect.Success":

                trace("Congratulations! you're connected");

                publishLiveStream();

                break;

           case "NetConnection.Connect.Rejected":

                trace ("Oops! the connection was rejected");

                break;

            case "NetStream.Play.Stop":

                trace("The stream has finished playing");

                break;

            case "NetStream.Play.StreamNotFound":

                trace("The server could not find the stream you specified");

                break;

            case "NetStream.Publish.Start":

                break;

            case "NetStream.Publish.BadName":

                trace("The stream name is already used");

                break;

          }

     }

       

     private function publishLiveStream():void {

          ns = new NetStream(nc);

          ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

          ns.client = new Object();

          mic = Microphone.getMicrophone();

          mic.setSilenceLevel(0);

          mic.rate = 8;

          //mic.codec = SoundCodec.NELLYMOSER;

          //trace(mic.codec);

   

          if (mic != null){

          ns.attachAudio(mic);

          ns.publish("livestream", "live");

     }

     else {

               trace("Please check your camera and microphone");

          }

     }        

  }

}


class CustomClient {

     public function onBWDone():void {}

}


4. Compile and play the file.
5. Run the Adobe Flash Media Administration Console and play the stream named livestream using a Linux or a Mac OS system, but not a Windows system. This stream should be a Nellymoser audio at 8KHz.

Playback starts, but audio is unintelligible in Linux and Mac OS Adobe Flash player.

TYIA.

Note.

Doesn't happen if I listen the stream using a Adobe Flash Player plugin or a Flash Media Administration Console for Windows systems.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    Participating Frequently
    Jun 21, 2009 6:43 PM UTC

    below 11khz sound quality may not work properly in mac and windows 2000 server .Some hardware and driver issue .You may instead use the speex codec . Its much better than nellymoser .

    You can found speex nellymoser comparison here :

    http://askmeflash.com/article_m.php?p=article&id=2

    Implementation of speex in this article in this article:

    http://askmeflash.com/article_m.php?p=article&id=1

    Translate
    Jun 11, 2009 1:17 PM UTC

    5 and 8khz are not properly supported on Mac. Use 11khz or higher.

    Translate