logo
down
shadow

how play and visualize audio streaming between browsers via peerconnection?


how play and visualize audio streaming between browsers via peerconnection?

By : wwm66
Date : November 29 2020, 01:01 AM
fixed the issue. Will look into that further Take a look at @cwilso's excellent demos on webaudiodemos.appspot.com, in particular Audio Recorder (which inputs audio from getUserMedia to Web Audio, analyses the data and draws to a canvas element) and Live Input Effects (which does something similar but with WebGL for the visualisation).
@paul-lewis's Audio Room also uses WebGL.
code :


Share : facebook icon twitter icon
what is the format to encode to play video/audio file to play in different browsers

what is the format to encode to play video/audio file to play in different browsers


By : BeYou
Date : March 29 2020, 07:55 AM
I wish did fix the issue. The answer really depends on how you're planning to play the files in the browsers. If you intend to play them in a flash player, you can convert them to MP4 (AAC+H.264) or FLV. If you want to play them using HTML5, then you need to have two different formats: MP4 (AAC+H.264) for some browsers and OGV (Ogg Vorbis) for others.
How do I get Html5 audio to play sound on click? (ogg for browsers like Firefox and mp3 for browsers like chrome)

How do I get Html5 audio to play sound on click? (ogg for browsers like Firefox and mp3 for browsers like chrome)


By : Zin Lin Phyo
Date : March 29 2020, 07:55 AM
around this issue Since you are creating only one element, you have to either create another element in HTML or create one using JavaScript.
code :
<audio id="Mp3Me" autoplay autobuffer controls>
<source src="Piano.mp3">
<source src="Piano.ogg">
</audio>
<a href="javascript:GuitarTrack();">Guitar</a>

<script type="text/javascript">
function GuitarTrack(){
    var Mp3Me= document.getElementById('Mp3Me');
    Mp3Me.children[0].src = "Guitar.mp3";
    Mp3Me.children[1].src = "Guitar.ogg";
    Mp3Me.load();
}
</script>
<audio id="Mp3Me" autoplay autobuffer controls>
<source src="Piano.mp3">
</audio>
<a href="javascript:GuitarTrack();">Guitar</a>

<script type="text/javascript">
function GuitarTrack(){
    var Mp3Me= document.getElementById('Mp3Me').getElementsByTagName('source');

    if(Mp3Me.length > 1) { //there are 2 elements
        Mp3Me[0].src = "Guitar.mp3";
        Mp3Me[1].src = "Guitar.ogg";
    }
    if(Mp3Me.length == 1) { //only one element, so we need to create the second one
        Mp3Me[0].src = "Guitar.mp3"; //changes existing element

        var node = document.getElementById('Mp3Me');
        var newelem = document.createElement('source');
        newelem.setAttribute('src', 'Guitar.ogg');
        node.appendChild(newelem); //creating new element with appropriate src                         
    }
    Mp3Me.load();
}
</script>
How to play a streaming audio file using the default audio player in Xamarin iOS

How to play a streaming audio file using the default audio player in Xamarin iOS


By : Gustavo Santana
Date : March 29 2020, 07:55 AM
this will help I'm developing a Xamarin app that will simply let the user click a link to a remote audio file, and I'd like the audio file to open in the native, default iOS media player. I don't need any in-app controls - the default audio player's controls will suffice. , Assuming the URI you have is a registered handler, you can just use:
code :
UIApplication.OpenUrl  
In Java, receive audio data streaming from a C# app over TCP sockets and play streaming as it is received

In Java, receive audio data streaming from a C# app over TCP sockets and play streaming as it is received


By : DesignSolv
Date : March 29 2020, 07:55 AM
Hope that helps First off, you will need to output the data as a SourceDataLine, not a Clip. The Clip cannot play until it has received the entire sound file.
The usual plan is to read the input line in whatever manner you want and convert it to the proper format in a loop calling the sdl.write() method.
code :
while(playerRunning)
{
    readBuffer = getInputPCM();
    audioBytes = convertToFollowAudioFormat(readBuffer);
    sourceDataLine.write(audioBytes, 0, sdlBufferSize);
}
for (int i = 0, n = buffer.length; i < n; i++)
{
    buffer[i] *= 32767;
    audioBytes[i*2] = (byte) buffer[i];
    audioBytes[i*2 + 1] = (byte)((int)buffer[i] >> 8 );
}
return audioBytes;
AudioFormat audioFormat = new AudioFormat(AudioFormat.Encoding.PCM_SIGNED, 
                44100, 16, 2, 4, 44100, false);
Info info = new DataLine.Info(SourceDataLine.class, audioFormat);
SourceDataLine sdl = (SourceDataLine)AudioSystem.getLine(info);
How to find out if audio is ready to play after changing position of streaming audio by seekbar?

How to find out if audio is ready to play after changing position of streaming audio by seekbar?


By : user3204354
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further I using MediaPlayer to streaming a audio from a url. all thing is working. but when user changes seekbar to change position of playing audio, a short time take long to prepare audio to play.after user changes seek bar position, I showing a ProgressBar. what I want something like a listener to find out player is now playing and hide ProgressBar my code is: , I found sulotion:
code :
 mediaPlayer.setOnBufferingUpdateListener(new MediaPlayer.OnBufferingUpdateListener() {
        @Override
        public void onBufferingUpdate(MediaPlayer mp, int percent) {

            float currentPlayingPercent = (100 * mp.getCurrentPosition() / (float)mp.getDuration());
            Log.i("tag", "buffer percent: " + percent);
            Log.i("tag", "media player percent: " + currentPlayingPercent);

            if (podcastPrg.getVisibility() == View.VISIBLE && percent > currentPlayingPercent) {
                podcastPrg.setVisibility(View.GONE);
                podcastBtn.setVisibility(View.VISIBLE);
            }
        }
    });
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org