Audio Buffer?

I have a presentation that was originally developed for local playback. It consists of audio, video and xml driven content. The presentation is divided into 5 sections. Now the client wants to put the presentation on the web and I'm having a little trouble understanding how to buffer the audio. What's a good way to check if the audio is buffering? how to set the buffer?
I made a run at this once and wasn't too successful.  For each section it follows this pattern:
Load swf. Swf loads XML. XML is converted into a slides which are Flash objects. Then the first slide starts by building the slide off of the stage. Then the audio is started and then the animation starts. The problem is I can't seem to sync up the audio with the slides on the web.
Should I created a timer to check a variable to see if the audio is buffered? If so what's the code. The isBuffering code is true until the audio is fully buffered. I'm just looking for a buffer of 3 seconds and then trigger my animation to start.
Thanks

No I'm just using .load. Should I configure this code differently?
var s:Sound;
var sc:SoundChannel;
//======================================================================================== =================================================
//     play sound function
//======================================================================================== =================================================
function playSound(thisURL:String):void{
//sc.stop();
s = new Sound();
s.addEventListener(ProgressEvent.PROGRESS, onLoadProgress);
s.addEventListener(Event.COMPLETE, onLoadComplete);
s.addEventListener(IOErrorEvent.IO_ERROR, onIOError);
var req:URLRequest = new URLRequest(thisURL);
s.load(req);
function onLoadProgress(event:ProgressEvent):void {
  var loadedPct:uint =  Math.round(100 * (event.bytesLoaded / event.bytesTotal));
  //trace("The sound is " + loadedPct + "% loaded.");
function onLoadComplete(event:Event):void {
  var localSound:Sound = event.target as Sound;
  //trace(localSound.length);
  sc = localSound.play();
  sc.addEventListener(Event.SOUND_COMPLETE, soundCompleted);
function onIOError(event:IOErrorEvent) {
  trace("The sound could not be loaded: " + event.text);
function soundCompleted(event:Event):void {
  //trace(nextFunction);
  sc.removeEventListener(Event.SOUND_COMPLETE, soundCompleted);
  //nextFunction();

Similar Messages

  • Blu-ray Error: fatal error, code 6, audio buffer underflows...

    Ughh.... So its been a few months since I stopped using CS6 Encore because it loves to crash for all kinds of bad reasons. Today I needed to do a new project, and used a simple 1920x1080p MP4 file created by Adobe Media Encoder, and used a basic menu template in Encore. Also added a slideshow timeline with one Mp3 audio set to loop. During the building image part of the build process, I get the fatal error code 6, audio buffer underflows. Total bitrate too high neat time = 0.00000 seconds -
    First off, I set the BR transcode setting to auto and it spends  pleanty of time transcoding the file to a 15mbps bitrate, so why is Encore not first taking care of all the source files correctly in transcoding...?

    Ok.... 100% the fault of the software. I am an SE, and build systems all the time for my business, so if I knew of these simple problems, Id go into the code and devise a solution...please Adobe, fix Encore.
    Here are my simple finding from solving this problem (first post):
    - Of the 2 simple Mp4 files produced by Media Encoder, one, which runs only 2 minutes, had a peak of a little over 10mbps. I dropped the file back into Encoder and set the same mp4 profile to max of 6mbps and then replaced the file in the encore project, ran build and it worked fine.
    SO.... If I can use a simple free bit of software to look at the bitrate of a file (google Bitrate Viewer) and determine that the peak was possibly too high, why oh why cant adobe write a better transoding logic algorythm to decide if a video in a timeline needs to be reprocessed at a slightly lower bitrate before just attempting a build and then throwing an error. For the love of all that is holy, please tweek your transcoding decision process to prevent these simple errors.

  • BluRay error message "code 6, audio buffer underflows. Total bitrate is too high near time = 000000 seconds."

    Hello,
    I’m trying to create BluRays using Encore and I keep getting the following error messages: ‘code 6, audio buffer underflows. Total bitrate is too high near time = 000000 seconds.”
    For info, I created a H264 Bluray - NTSC 24fps master from an Apple prores HQ in Adobe Media Encoder. Duration: 52m, size: 11go. I'm on Mac OSX 10.9.5, the bluray burner is Samsung SE-506CB/RSWD and the BR disks are TDK Blu-ray Disc 50 Spindle - 25GB 4X BD-R - Printable.
    I looked around in forums and tried the following without success: replacing disk name to shorter name without space, creating bluray without menu frame, I also tried with a Mpeg2 bluray master. I tried to export a new master but I can't seem to be able to change the audio bitrate.
    Can anyone please help ?
    Thanks.

    Hi Stan, thanks for getting back.
    I tried to create a new master from Media Encoder but I can only export audio in PCM, I don't get a dolby option. See pic below.
    I tried a new project in Encore and chose PCM instead of Dolby in the preference menu, but I still got the same error. Should I try again limiting bitrate to 15 ? I was on 30 before.
    Please help, I've already wasted 10 bluray and this is getting really frustrating!

  • Blu-ray Error: "file already exists", Code: "6", "Audio buffer underflows. Total bit rate too high

    Hopefully someon can help me out here - I'm stuck in my tracks.    I'm reading through lots of threads on this topic, but don't understand what is going wrong here.    CS6.  Note: I have used Encore prior to put this material on a disc.  I presently have a separate sequence paired down with only about 1/5 of the whole production.   1920x1080i, 29.97, H.264 Blu-ray, VBR 2-pass, PCM inside PP to produce .m4v/.wav.  Here is what is confusing me - I tried a target of 10 and a max of 20 and I still get this error.   I have tried different max bit rate "Default Transcode" settings in Encore as well.    Note the time code listed "0.000000" - maybe that tells someone something.    I don't really understand Encore yet, so maybe it is something I set wrong in Encore vs. my exports?

    There are many similar, but not identical errors. And I assume you had already followed John's advice to review older threads. It is true they never quite pin a single set of issues down.
    What specific version of Encore? Updated to 6.0.2.004? Encore staff once said updates solved some of these errors.
    You say .wav for source files in Encore. But what format in the project? ac3?
    Your versiono f the error is different from other one I see because it has a "audio buffer" rather than "video buffer" underflow.

  • Allocating Audio buffer [Windows driver]

    I want to use the following IMiniportWaveRTStream::AllocateAudioBuffer method which is defined in portcls.h. 
        NTSTATUS AllocateAudioBuffer(
          [in]   ULONG               RequestedSize,
          [out]  PMDL                *AudioBufferMdl,
          [out]  ULONG               *ActualSize,
          [out]  ULONG               *OffsetFromFirstPage,
          [out]  MEMORY_CACHING_TYPE *CacheType
    But i want to use it in a C file. I found a structure which achieves the same but with one extra parameter.
        NTSTATUS AllocateAudioBuffer(
          INTERFACE THIS,
          [in]   ULONG               RequestedSize,
          [out]  PMDL                *AudioBufferMdl,
          [out]  ULONG               *ActualSize,
          [out]  ULONG               *OffsetFromFirstPage,
          [out]  MEMORY_CACHING_TYPE *CacheType
     The interface strucure is defined as
        typedef struct _INTERFACE {
            USHORT Size;
            USHORT Version;
            PVOID Context;
            PINTERFACE_REFERENCE InterfaceReference;
            PINTERFACE_DEREFERENCE InterfaceDereference;
            // interface specific entries go here
        } INTERFACE, *PINTERFACE;
    What does this INTERFACE refers too? And how to obtain a reference to it.
    Reference: https://msdn.microsoft.com/en-us/library/windows/hardware/ff536744(v=vs.85).aspx

    Hello Don,
    Thanks for the reply. I want to redirect audio data that i receive from SCO Channel to my speaker. Following is structure for the request
    struct _BRB_SCO_TRANSFER {
    BRB_HEADER Hdr;
    BTH_ADDR BtAddress;
    SCO_CHANNEL_HANDLE ChannelHandle;
    ULONG TransferFlags;
    ULONG BufferSize;
    PVOID Buffer;
    PMDL BufferMDL;
    ULONGLONG DataTag;
    };Can i get audio buffer pointer to pass it on this request?

  • Audio buffer pointer in kernel driver

    I m writing a kernel driver and I have some audio data that i want to play through speaker. How to get a pointer to audio buffer? So
    that i can use this buffer for writing audio data

    Accessing the audio stack from within a driver is possible, but it is very, very difficult (principally because the audio driver documentation is horrible). All the samples in the WDK are for interfacing hardware to the audio stack, not making use of the
    stack from a driver. I have interfaced to the audio stack for a few clients - but never in the way that you want - and it was always felt like I was sticking needles into my eyes. Unless you need this capability for a product, then the effort needed
    to implement this will likely exceed your patience.
     -Brian
    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

  • Le is changing audio buffer as it likes...

    I wonder why LE 8 changes the buffer that I choosed, when I change settings on guitar amp pro. For example, when I change amp model or switch on the reverb, I suddenly have unplayable latency of, let´s say, 1000 samples or more. That means I have to go to audioprefs and change buffer from 128 to 256 samples, for example. Then it works again. But this makes Logic unusable while I cannot make changes when playing live. Anyone got the same problem?
    Message was edited by: m.lo

    Open the .dv file with QuickTime and then open the Movie Properties window.
    Highlight the audio track and click the Audio Settings button. You'll see the track assignments in the lower right.
    Use Save As if you edit any setting.

  • Audio Buffer error with command line app

    I run a program called SBAGEN, which is a binaural beat frequency program that runs from Terminal.app - lately, when I invoke one of the scripts for this program, I get this error:
    Set audio output buffer size failed, status = 1852797029
    any ideas as to how to solve this?
    Thanks

    Resolved this issue on my own:
    *SYSTEM PREF—-> SOUND —–> SOUND EFFECTS*
    I needed to make sure that under +SOUND EFFECTS+, that the following was selected in the drop down menu +“Play sounds and alerts from”+: *SELECTED SOUND OUTPUT DEVICE*

  • Clicks and Pops in Audio even with High Buffer Values

    Dear Community,
    I'm running into a problem with my Mac Pro 2008 for which I need urgent help.
    I have a Mac Pro 2008 which I use to do some audio production and mixing.
    I use 10.8 Mountain Lion for some time now, mainly with Avid Pro Tools 10 and Logic Pro 9.
    My audio interfaces of choice are the Echo Audio Audiofire 8 and an Eleven Rack (USB) which I never use simultaneously. For tracking guitars and bass I use the Eleven Rack but for mixing and adding other instruments I use the Echo Audio because of its multichannel capabilities.
    I had this configuration for many months / years without any kind of problem and being able to use very low buffer values (128, 64 and even 32 bits) with very low latency values (ideal for tracking guitar with software monitoring).
    Now I'm running with problems with audio clicks and pops in all audio streams independently of the audio interface I use.
    I've tried every tip I found on the web for optimizing my mac for audio with no success.
    Independently of the buffer I establish in Pro Tools or Logic (or any other audio software, for that matters) I always get the same harsh, distorted audio, with permanent clicks and pops. It's the same with pre-recorded audio or when using just an armed track with software monitoring. Even when using just Amplitube 3 in standalone mode, I can't get audio working correctly. Raising the audio buffer to 4096 (!!!) or lowering to 64 is the same. The output get garbled, distorted, harsh, with permanent clicks and pops (on the Audiofire or the Eleven Rack).
    I've already tried reinstalling drivers, mangled with all audio preferences possible with no success.
    I'm considering, as a final option, to reinstall the OS and all audio software from scratch but this is the very final possibility because of the long long hours needed to do so.
    Does anyone have some idea about this?
    Could anyone help me?
    Best Regards,
    Luis Mota

    Luis, the sound you're describing does not sound like a clock problem.
    Sync set to "Internal"
    To check you can go to Settings/Synchronization  uncheck "Auto Enable external sync".
    I'm guessing like most Mac users you have the operating system set to auto update, if so the system may have updated on it's own so you can't be sure you're running the same system that worked perfectly in the past.
    I disable every "auto" b.s. Apple/OSX tries to force on users... for pro audio users, it generally causes problems.
    Here's some things to try.
    1. Set the Mac's audio preferences to use only built-in audio for both recording and playback. Do so in both System preferences/sound and Audio-MIDI Setup.   Turn off the Mac, unplug and audio interface you have hooked up. Restart the Mac, Plug in an audio interfaces (doesn't matter which one) open Logic, go to Preferences Audio and select the installed interface, even if it's selected already, set buffer to 256.
    Any difference?
    2. Create a New User account and try running Logic from there.

  • Premiere Elements 12 - Gaps in audio playback

    Hello everyone!
    I have a problem with Adobe Premiere Elements 12: when I play video in timeline or preview window, there are lots of gaps and pauses in audio playback, even though video is playing smoothly. Usually the pattern goes like this: 2 seconds of clean audio - 0,5 seconds silence - 2 seconds of clean audio... etc.
    I have tried the following:
    - change audio buffer settings
    - change audio device (I have tested with integrated audio chip ("High Definition Audio"), M-Audio Fast Track Pro and cheap USB audio interface - same results with all of them)
    - start a new project with correct settings and import only one file
    - disable background antivirus monitoring
    Usually source material is AVCHD 1440x1080 25fps (PAL, MTS-file) from small Sony camera, but this problem seems to continue even if I insert only still photo and mp3 audio to timeline. CPU load is about 6% during playback. It seems like Premiere Elements makes these gaps to playback signal before sending it to audio hardware?
    Computer specs: Intel Core i7-4770 @ 3,4GHz, 16 GB RAM, 128GB SSD drive for OS & software and 2.0TB 7200 rpm drive for video, Intel HD Graphics 4600, Windows 8 (64bit).
    I would be really grateful if someone could give me some tips to solve this annoying audio playback problem.
    EDIT: I forgot to mention that this problem occurs all the time - even when video is rendered in timeline.

    Thanks for the quick response, TonyPh12345.  Clearly not what I was hoping for but not unexpected. BB

  • Kontakt 4.1.1 and Logic 9.1.1 needs Max buffer

    I posted this on the NI forum too.I have 1 instance of Kontakt 4.1.1 in Logic 9.1.1 64bit with only 4 sounds loaded and have to set the buffer to Max 1024 otherwise all I get is clicks and pops on playback.The strange part is,when I first loaded this kontakt patch, it ran great with a buffer of 128.I left my computer for a couple hours and when I returned and hit play, everything was glitching out.When I bypass Kontakt, the song plays fine at a low buffer setting.when I run Kontakt, I get one of the CPU meters in Logic hitting red.Kontakt shows very low RAM and voice usage and I have 8 GB of RAM in a Mac Pro 2.66 Duo core.I have tried Logic in 32 bit mode,enabled Kontakt memory server,reloaded a blank Kontakt then loaded the patch.switched between Digi 192 (core audio) and Motu 828 MKII,rebooted,repaired permissions.The only way to get smooth playback is to set Logic's audio buffer to 1024 which makes it virtually impossible to play a part in real time.I know this isn't right as it was working fine at first.Any thoughts?

    Hello -
    I have a similar set-up (noted below, with Mac OS X 10.6.4). I'm still experimenting with different configurations. Currently, I have Kontakt's memory server (don't remember its official name) engaged when in 64-bit mode (both Kontakt 4 and Logic Pro). On one project, I have a total of about 32 instruments in use including ones from Kontakt and EXS. All is well.
    Now, it's my understanding that when in 64-bit mode, one doesn't need to use Kontakt's memory server. Have you tried either engaging or disengaging the server?
    Also. . . I'm using MOTU's 2408 MK3. As far as I know, its drivers are updated to the latest ones. This also may be helping me out. Are the drivers to your audio drivers the "latest and the greatest"??
    Finally, is your OS updated to 10.6.4? Your Info currently indicates that your using OS 10.6.3. (Don't know if this makes any difference.)
    It's interesting how people can have similar set-ups with differing results.

  • IOS RTMP live stream audio

    Hi guys hopefully some of you will be able to help me.
    I am trying to stream audio from a live RTMP feed using the NetConnection and NetStream classes. I've managed to get my app running no problem on Android, however I am having some major difficulties getting it to play the audio back on iPad. Interestingly it works in the device emulators when debugging, however I'm assuming this is not really an accurate representation. I've tried streaming the RTMP in both AAC and MP3, but with no luck from either. I can verify through debug that it has connected to the stream, however I just get no audio playing.
    Everything I've read about seems to suggest that this is possible on IOS as I'm only interested in audio and not video. Can anyone help?
    Code sample below (it's quick and dirty! ).
    THanks in advance!
    <?xml version="1.0" encoding="utf-8"?>
    <s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
                        xmlns:s="library://ns.adobe.com/flex/spark" title="Audio" creationComplete="init()">
              <s:layout>
                        <s:VerticalLayout paddingLeft="10" paddingRight="10"
                                                                  paddingTop="10" paddingBottom="10"/>
              </s:layout>
              <fx:Script>
                        <![CDATA[
                                  import flash.media.Video;
                                  import flash.net.NetConnection;
                                  import flash.net.NetStream;
                                  import mx.core.UIComponent;
                                  private var vid:Video;
                                  private var videoHolder:UIComponent;
                                  private var nc:NetConnection;
                                  private var defaultURL:String="[STREAM]";
                                  private var streamName:String="[STREAMNAME]";
                                  private var ns:NetStream;
                                  private var msg:Boolean;
                                  private var intervalMonitorBufferLengthEverySecond:uint;
                                  private function init():void
                                            vid=new Video();
                                            vid.width=864;
                                            vid.height=576;
                                            vid.smoothing = true;                           
                                            //Attach the video to the stage             
                                            videoHolder = new UIComponent();
                                            videoHolder.addChild(vid);
                                            addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);
                                            grpVideo.addElement(videoHolder);
                                            connect();
                                  public function onSecurityError(e:SecurityError):void
                                            trace("Security error: ");
                                  public function connect():void
                                            nc = new NetConnection();
                                            nc.client = this;
                                            nc.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
                                            nc.objectEncoding = flash.net.ObjectEncoding.AMF0;
                                            nc.connect(defaultURL);      
                                  public function netStatusHandler(e:NetStatusEvent):void
                                            switch (e.info.code) {
                                                      case "NetConnection.Connect.Success":
                                                                trace("audio - Connected successfully");
                                                                createNS();                
                                                                break;
                                                      case "NetConnection.Connect.Closed":
                                                                trace("audio - Connection closed");                
                                                                //connect();
                                                                break; 
                                                      case "NetConnection.Connect.Failed":
                                                                trace("audio - Connection failed");                
                                                                break;
                                                      case "NetConnection.Connect.Rejected":
                                                                trace("audio - Connection rejected");                                  
                                                                break; 
                                                      case "NetConnection.Connect.AppShutdown":
                                                                trace("audio - App shutdown");                                 
                                                                break;         
                                                      case "NetConnection.Connect.InvalidApp":
                                                                trace("audio - Connection invalid app");                                   
                                                                break; 
                                                      default:
                                                                trace("audio - " + e.info.code + "-" + e.info.description);
                                                                break;                                                                                                    
                                  public function createNS():void
                                            trace("Creating NetStream");
                                            ns=new NetStream(nc);
                                            //nc.call("FCSubscribe", null, "live_production"); // Only use this if your CDN requires it
                                            ns.addEventListener(NetStatusEvent.NET_STATUS, netStreamStatusHandler);
                                            vid.attachNetStream(ns);
                                            //Handle onMetaData and onCuePoint event callbacks: solution at http://tinyurl.com/mkadas
                                            //See another solution at http://www.adobe.com/devnet/flash/quickstart/metadata_cue_points/
                                            var infoClient:Object = new Object();
                                            infoClient.onMetaData = function oMD():void {};
                                            infoClient.onCuePoint = function oCP():void {};        
                                            ns.client = infoClient;
                                            ns.bufferTime = 0;   
                                            ns.play(streamName);  
                                            ns.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);
                                            function asyncErrorHandler(event:AsyncErrorEvent):void {
                                                      trace(event.text);
                                            intervalMonitorBufferLengthEverySecond = setInterval(monPlayback, 1000);
                                  public function netStreamStatusHandler(e:NetStatusEvent):void
                                            switch (e.info.code) {
                                                      case "NetStream.Buffer.Empty":
                                                                trace("audio - Buffer empty: ");
                                                                break;
                                                      case "NetStream.Buffer.Full":
                                                                trace("audio - Buffer full:");
                                                                break;
                                                      case "NetStream.Play.Start":
                                                                trace("audio - Play start:");
                                                                break;
                                                      default:
                                                                trace("audio - " + e.info.code + "-" + e.info.description);
                                                                break;
                                  public function monPlayback():void {
                                            // Print current buffer length
                                            trace("audio - Buffer length: " + ns.bufferLength);
                                            trace("audio - FPS: " + ns.currentFPS);
                                            trace("audio - Live delay: " + ns.liveDelay);
                                  public function onBWDone():void {
                                            //Do nothing
                                  public function onFCSubscribe(info:Object):void {      
                                            // Do nothing. Prevents error if connecting to CDN.    
                                  public function onFCUnsubscribe(info:Object):void {    
                                            // Do nothing. Prevents error if connecting to CDN.    
                        ]]>
              </fx:Script>
              <s:Group id="grpVideo">
              </s:Group>
    </s:View>

    Just an update on this for anyone coming along after me.
    I've managed to get this working on MP3 but not AAC (I guess AAC just isn't supported?).
    My problem was the buffertime. The docs seemed to indicate it shoudl be set to 0 for live streaming, however switching it to "1" solved my problem on the particular stream I was pointing at.
    So essentially justchanged the above line:
                                            ns.bufferTime = 0;  
    to
                                            ns.bufferTime = 1;  
    Would be great to find out if anyone has gotten AAC working however...

  • Stream audio from sound card input thru network

    Good Day:
    I have an application where I need to access instruments at a remote location.  Command/Control of the instruments is not a problem, but I also need to stream the audio present at the remote system's sound card thru the network connection.  Any suggestions on how to accomplish this via LabWindows?
    Thanks in advance for any replies.
    -Ed

    Hi Ed,
    First, I was wondering, how do you get the audio from the sound card?  Is it from a LabWindows program? I've never done that.  Second, I was wondering how do you play the audio on the remote machine?  Is that through a LabWindows program?  I've never done that either.
    But I was wondering if just a remote PC app would do the job.  Like admins use to take over your PC from there desk and fix problems.  I assume they have these that send the audio thru the net as well as the screen.  Then on the radio's PC you just need a LabWindows program to control the radio and some other app to play sound from the sound card input to the local speaker.  Then the remote PC app would magically transfer the screen and audio from the radio PC to the remote PC.
    Otherwise, I can just say that to stream the audio thru the net, after the Radio's PC gets it off the sound card somehow, I would just set up two TCP servers on the remote PC, one for audio and one for the commands/control.  When the remote PC client connects to the audio server the audio server would just start sending audio data to the client.  The client would receive the data and put it in a big buffer to handle network speed variation.  Let the buffer fill up to like a second or more worth of data before having anothe function/thread read the buffer data and give the data to the client PC's sound card.  Big problem is that the client PC's sound card will alway's consume the data at a slightly different speed than the servers sound card produces it.  Different clocks running at slightly different frequencies.  So the client function that reads the audio buffer to give it to the sound card must play games.  If the buffer is shrinking over time then it has to create extra samples to give to the sound card, just duplicating a sample every 100 samples or whatever. If the buffer is growing over time then it throws away a sample every 100 sample or whatever.  So it's kind of a challenge to manage the buffer with the variable speed of the net transfering data and the two different rates of producing and consuming the audio data.
    LabWindows has the TCP server create and client create functions so that's pretty easy.  The harder part is that you probibly want to set the Radio's PC to a fixed IP address so that you can connect to it without worrying about domain names and such.  Then the two TCP ports that the LabWindows uses for command and audio might need to be setup in all the routers to let you establish a connection.  Your IT guy's can answer that.
    PS. you can play around with this suff on one PC by using the RegisterTCPServerEx function and setting the local host address to "localhost", or "127.0.0.1" on one LabWindows project and using the corresponding ConnectToTCpServerEx with "NULL" as the server host name on another LabWindows project.  This creates a virtual TCP connection on the same machine.  This does not duplicate the different audio clock issue I talked about above.

  • Load and Play audio file (either sound or music) from my computer using DirectSound in C++

    #include "stdafx.h"
    #include <dsound.h>
    class AudioPlayer
    private:
    unsigned long long start_point,
    playback_point,
    break_point;
    bool now_playing, loop, ignore_start_point;
    int speed;
    //and any data that stores an audio (can be either sound or music)
    public:
    void Play_or_Resume(); //Either starts playing or resumes the audio stored in private (Runs a thread that either increments or decrements the playback_point by the speed member and sets the now_playing member to true).
    void Pause(); //Stops playing the audio stored in private until Play_or_Resume method is called (Just suspends the thread that was mentioned above and sets the now_playing member to false).
    void Play(unsigned long long from = 0, unsigned long long length = -1, bool move_start_point_too = true);
    //Plays audio from the value of the 'from' parameter along the value of the 'length' parameter and sets the now_playing member to true.
    //Playback point is pushed to the value of the 'from' parameter, and break point is pushed to the result of from + length.
    //If move_start_point_too parameter is true, then also start point is pushed where playback point is pushed too (to the value of the 'from' parameter).
    //Also the value of the 'from' parameter is an absolute position, but otherwise (if move_start_point_too parameter is false) it ('from' parameter) is relative to start point's position until it (start point) is ignored.
    //The value of the 'from' parameter never can be negative!
    void MovePlaybackPoint(unsigned long long new_position); //Modifies playback point position that is stored in private to a new position that indicates to sample no. new_position.
    unsigned long long GetPlaybackPointPosition(); //Returns playback point's position that has been alreadyS mentiond above.
    unsigned long long GetLength(); //Returns total number of samples in the audio stored in private.
    void MoveBreakPointTo(unsigned long long new_position); //Moves the break point to a new position that indicates to sample no. new position.
    //If the loop member is false, then audio should always stops playing and also set the now_playing member to false, when playback point reaches the break point, even the Pause method was not called.
    //Then calling again the Play_or_Resume method will bring the playback point back to start point (the default value for this member is zero 0).
    //But if the loop member is true, then playback point just returns to start point immediately and continue playing from there (now_playing remains true and it's value is unchanged).
    //There is a possibility to move the break point to a negative integer, so audio either stops and sets now_playing to false or replays from start point and left now_playing true according to the loop member, at the end of the audio. The default value of break point member is minus one -1 .
    unsigned long long GetBreakpointPosition(); //Returns the position of the break point that has been already mentioned above.
    void MoveStartPointTo(unsigned long long new_position); //Moves the start point to a new position that indicates to sample no. new position.
    unsigned long long GetStartPointPosition(); //Returns the position of the start point that has been already mentioned above.
    void EnableRepeatMode(); //Sets the private loop member to true.
    void DisableRepeatMode(); //Sets the private loop member to false.
    void ToggleRepeatMode(); //If loop was true before calling this function, so after it is false. Otherwrise it is true.
    bool IsRepeating(); //Returns whether audio repeats itself (from start point to either breakpoint or end of buffer). This function just returns the value of the loop member.
    void SetSpeed(int num_sam_per_sec); //Modifies the number of samples that are played in every second.
    //If number (integer) is negative, then audio is played in backward.
    //When playback point reaches start point, then it is transferred to break point if it's position is not negative. Otherwise it is transferred to the end of the audio buffer.
    void IgnoreStartPoint(); //Sets the ignore_start_point member to true. Then all methods always relate to start point as zero (even if it's value is not zero).
    void ReferStartPoint(); //Sets the ignore_start_point member to false.
    bool IsStartPointIgnored(); //Returns whether start point is ignored or not. This method just returns the value of ignore_start_point member.
    int GetSpeed(); //Returns the number of samples that are played in every second.
    void SetNumberOfChannels(byte new_value); //Modifies number of channels.
    byte GetNumberOfChannels(); //Returns number of channels.
    void SetBlockAlign(byte new_value); //Sets block align.
    byte GetBlockAlign(); //Returns block align.
    const char* LoadAudioFromComputer(const char* path_and_name_of_file, AudioPlayer* lpAp, bool auto_start_playing = true);
    //This function fills the instance pointed by 'lpAp' parameter with the data of the audio file redirected by 'path_and_name_of_file' parameter, and calls the Play_or_Resume method of this instance if auto_start_playing is true.
    //If the function succeeds, then it returns "succeed". Otherwise (if the function fails) then it returns an error string that describes the problem (the reason it failed). It can be sent to output, so it can be read, by either call to MessageBox, printf, std::cout, TextOut, DrawText functions and etc.
    //The function can fails, because the file was not exist, or could not be opened for reading, because it was opened by another process, or the file was either encrypted or protected, or corrupted, or was not audio file, but text, image and etc.
    I want to implement all methods of the AudioPlayer class and the LoadAudioFromComputer function by myself using DirectSound (the <dsound.h>) and all functions, interfaces, methods, structures, etc... that this header provides, but I don't know how! I
    need your help! This is difficult for me to find in the internet the information I need to do this. MSDN is teaching all this stuff, but this is too difficult! I need you to implement all these methods of the AudioPlayer class and the LoadAudioFromComputer
    function for me using DirectSound and the <dsound.h> and the explanations I wrote in comments, and then post the code. I will copy it to mine and read it all to learn. Please use comments so I can understand. I will thank and appreciate anyone who will
    donate his time to help me and do this for me! :D

    Microsoft pulled the plug on DirectSound HAL in Vista due to lack of hardware support. The SAL exists for
    software compatibility, good intention but bad performance as there is no longer a direct path from
    DirectSound to audio drivers.
    People choose DirectSound for its Direct-ness
    but there is no reason to choose it now.
    DirectX SDK was integrated
    with WIndows SDK which ships with Visual Studio 2012 so you don't need additional downloads for
    WASAPI and XAudio 2.
    Just look up the documentation for headers/librarieslike every other Windows API you use. If you have a hard time to find the documentation then you need to go to search engines and find search engine tutorials. 
    There are plenty of samples for both WASAPI and XAudio 2, both in the Windows SDK and online. The DirectX team has some suggestions on which to use on their team blog.
    You can find experts for those APIs at the Windows Desktop Pro-Audio Application Development forum and the
    Audio/XACT forum on MSDN (link left out for you to practice your search skills). Again, it is fine to ask for hints but don't ask the whole
    solution. You are competing with others who just need a hint to finish work here. The time spent on working on your assignment would be better spent on helping on giving hints to others. 
    Visual C++ MVP

  • [SOLVED] MPlayer/Pulseaudio, No audio output

    I can't seem to figure out how to make mplayer's "ao=pulse" option to work.
    It works fine with alsa, but I couldn't find anything definitive on Google about what might be wrong.  I think one of the problems might be that I couldn't find any errors in mplayer's output.
    Here is the verbose output of an example file:
    $ mplayer -v example.mp4
    MPlayer SVN-r35107-4.7.2 (C) 2000-2012 MPlayer Team
    CPU vendor name: GenuineIntel max cpuid level: 11
    CPU: Intel(R) Core(TM) i5 CPU M 430 @ 2.27GHz (Family: 6, Model: 37, Stepping: 2)
    extended cpuid-level: 8
    extended cache-info: 16801856
    Detected cache-line size is 64 bytes
    CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSSE3: 1
    Compiled with runtime CPU detection.
    get_path('codecs.conf') -> '/home/user/.mplayer/codecs.conf'
    Reading optional codecs config file /home/mike/.mplayer/codecs.conf: No such file or directory
    Reading optional codecs config file /etc/mplayer/codecs.conf: 198 audio & 409 video codecs
    init_freetype
    Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
    get_path('fonts') -> '/home/user/.mplayer/fonts'
    Configuration: --prefix=/usr --enable-runtime-cpudetection --disable-gui --disable-arts --disable-liblzo --disable-speex --disable-cdparanoia --disable-openal --disable-libdv --disable-musepack --disable-esd --disable-mga --disable-ass-internal --enable-xvmc --enable-radio --enable-radio-capture --disable-vdpau --enable-vaapi --language=all --confdir=/etc/mplayer
    CommandLine: '-v' 'example.mp4'
    Using nanosleep() timing
    get_path('input.conf') -> '/home/user/.mplayer/input.conf'
    Reading optional input config file /home/user/.mplayer/input.conf: No such file or directory
    Parsing input config file /etc/mplayer/input.conf
    Input config file /etc/mplayer/input.conf parsed: 92 binds
    get_path('example.mp4.conf') -> '/home/user/.mplayer/example.mp4.conf'
    Playing example.mp4.
    get_path('sub/') -> '/home/user/.mplayer/sub/'
    [file] File size is 2285184 bytes
    STREAM: [file] example.mp4
    STREAM: Description: File
    STREAM: Author: Albeu
    STREAM: Comment: based on the code from ??? (probably Arpi)
    libavformat version 54.25.104 (internal)
    Configuration: --enable-gpl --enable-postproc
    LAVF_check: QuickTime / MOV
    libavformat file format detected.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]ISO: File Type Major Brand: mp42
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]File position before avformat_find_stream_info() is 10279
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]first_dts 14 not matching first dts 0 in que
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]first_dts 14 not matching first dts 0 in que
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]first_dts 14 not matching first dts 0 in que
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]first_dts 14 not matching first dts 0 in que
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]first_dts 14 not matching first dts 0 in que
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]File position after avformat_find_stream_info() is 31013
    ==> Found video stream: 0
    ======= VIDEO Format ======
    biSize 79
    biWidth 640
    biHeight 360
    biPlanes 0
    biBitCount 24
    biCompression 875967048='H264'
    biSizeImage 691200
    Unknown extra header dump: [1] [42] [c0] [1e] [ff] [e1] [0] [18] [67] [42] [c0] [1e] [da] [2] [80] [bf] [e5] [84] [0] [0] [3] [0] [4] [0] [0] [3] [0] [c0] [3c] [58] [ba] [80] [1] [0] [4] [68] [ce] [3c] [80]
    ===========================
    [lavf] stream 0: video (h264), -vid 0
    ==> Found audio stream: 1
    ======= WAVE Format =======
    Format Tag: 20557 (0x504D)
    Channels: 2
    Samplerate: 44100
    avg byte/sec: 12021
    Block align: 1
    bits/sample: 16
    cbSize: 16
    Unknown extra header dump: [12] [10] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0] [0]
    ==========================================================================
    [lavf] stream 1: audio (aac), -aid 0, -alang und
    LAVF: 1 audio and 1 video streams found
    LAVF: build 3545448
    VIDEO: [H264] 640x360 24bpp 24.000 fps 562.6 kbps (68.7 kbyte/s)
    [V] filefmt:44 fourcc:0x34363248 size:640x360 fps:24.000 ftime:=0.0417
    Clip info:
    major_brand: mp42
    minor_version: 0
    compatible_brands: isommp42
    creation_time: 2013-03-18 01:56:42
    Load subtitles in ./
    get_path('sub/') -> '/home/user/.mplayer/sub/'
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xeed4a0]demuxer injecting skip 2112
    X11 opening display: :0
    vo: X11 color mask: FFFFFF (R:FF0000 G:FF00 B:FF)
    vo: X11 running at 1600x900 with depth 24 and 32 bpp (":0" => local display)
    [x11] Detected wm supports NetWM.
    [x11] Detected wm supports FULLSCREEN state.
    [x11] Detected wm supports ABOVE state.
    [x11] Detected wm supports BELOW state.
    [x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
    [VO_XV] Using Xv Adapter #0 (Intel(R) Textured Video)
    [xv common] Drawing no colorkey.
    [xv common] Maximum source image dimensions: 2048x2048
    ==========================================================================
    Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
    libavcodec version 54.53.100 (internal)
    Configuration: --enable-gpl --enable-postproc
    INFO: libavcodec init OK!
    Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
    ==========================================================================
    ==========================================================================
    Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
    dec_audio: Allocating 1536000 + 131072 = 1667072 bytes for output buffer.
    FFmpeg's libavcodec audio codec
    INFO: libavcodec "aac" init OK!
    AUDIO: 44100 Hz, 2 ch, s16le, 96.2 kbit/6.81% (ratio: 12021->176400)
    Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
    ==========================================================================
    Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
    [libaf] Adding filter dummy
    [dummy] Was reinitialized: 44100Hz/2ch/s16le
    [dummy] Was reinitialized: 44100Hz/2ch/s16le
    Trying preferred audio driver 'pulse', options '[none]'
    AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
    AO: Description: PulseAudio audio output
    AO: Author: Lennart Poettering
    Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
    [dummy] Was reinitialized: 44100Hz/2ch/s16le
    [dummy] Was reinitialized: 44100Hz/2ch/s16le
    Starting playback...
    Increasing filtered audio buffer size from 0 to 46144
    Unsupported PixelFormat 61
    Unsupported PixelFormat 81
    Unsupported PixelFormat 61
    [VD_FFMPEG] Trying pixfmt=0.
    [ffmpeg] aspect_ratio: 0.000000
    Unsupported PixelFormat 61
    VDec: vo config request - 640 x 360 (preferred colorspace: Unknown 0x0000)
    Trying filter chain: vo
    Could not find matching colorspace - retrying with -vf scale...
    Opening video filter: [scale]
    SwScale params: -1 x -1 (-1=no scaling)
    Trying filter chain: scale vo
    The selected video_out device is incompatible with this codec.
    Try appending the scale filter to your filter list,
    e.g. -vf spp,scale instead of -vf spp.
    [VD_FFMPEG] Trying pixfmt=1.
    [ffmpeg] aspect_ratio: 0.000000
    VDec: vo config request - 640 x 360 (preferred colorspace: H.264 VA-API Acceleration)
    Trying filter chain: vo
    Could not find matching colorspace - retrying with -vf scale...
    Opening video filter: [scale]
    SwScale params: -1 x -1 (-1=no scaling)
    Trying filter chain: scale vo
    The selected video_out device is incompatible with this codec.
    Try appending the scale filter to your filter list,
    e.g. -vf spp,scale instead of -vf spp.
    Unsupported PixelFormat 81
    [VD_FFMPEG] Trying pixfmt=2.
    [ffmpeg] aspect_ratio: 0.000000
    Unsupported PixelFormat 81
    VDec: vo config request - 640 x 360 (preferred colorspace: Unknown 0x0000)
    Trying filter chain: vo
    Could not find matching colorspace - retrying with -vf scale...
    Opening video filter: [scale]
    SwScale params: -1 x -1 (-1=no scaling)
    Trying filter chain: scale vo
    The selected video_out device is incompatible with this codec.
    Try appending the scale filter to your filter list,
    e.g. -vf spp,scale instead of -vf spp.
    [VD_FFMPEG] Trying pixfmt=3.
    [ffmpeg] aspect_ratio: 0.000000
    VDec: vo config request - 640 x 360 (preferred colorspace: Planar YV12)
    Trying filter chain: vo
    VDec: using Planar YV12 as output csp (no 0)
    Movie-Aspect is undefined - no prescaling applied.
    VO Config (640x360->640x360,flags=0,'MPlayer',0x32315659)
    VO: [xv] 640x360 => 640x360 Planar YV12
    VO: Description: X11/Xv
    VO: Author: Gerd Knorr <[email protected]> and others
    Xvideo image format: 0x32595559 (YUY2) packed
    Xvideo image format: 0x32315659 (YV12) planar
    Xvideo image format: 0x30323449 (I420) planar
    Xvideo image format: 0x59565955 (UYVY) packed
    Xvideo image format: 0x434d5658 (XVMC) planar
    using Xvideo port 75 for hw scaling
    *** [vo] Exporting mp_image_t, 640x360x12bpp YUV planar, 345600 bytes
    Unicode font: 2293 glyphs.
    Unicode font: 2293 glyphs.
    A: 4.3 V: 4.3 A-V: 0.000 ct: 0.042 0/ 0 4% 0% 0.3% 0 0
    Uninit audio filters...
    [libaf] Removing filter dummy
    Uninit audio: ffmpeg
    Uninit video: ffmpeg
    vo: uninit ...
    Exiting... (Quit)
    Is there something else I can check with the MPlayer feedback?
    Also, I'm using mplayer-vaapi, but I took a look at its abs PKGBUILD and it didn't have any configure options disabling pulseaudio.  At least I'm assuming the abs PKGBUILDs reflect the default options that the binaries come with.
    Last edited by mellowmaroon (2013-04-14 05:26:07)

    You were right about it being muted through the PA mixer!  I didn't think about that, and installed pavucontrol.  I figure I'll try to learn how to learn to do it through pactl/pacmd sometime.
    Though, I have "flat-volumes = no" so I have a kind of global maximum volume and normally can set other applications' volumes individually from within the program. Pavucontrol reflects MPD+ncmpcpp volume changes, but apparently doesn't seem to pick up MPlayer's application volume.
    Is there any way to fix MPlayer so it's internal volume adjustment will be the same as what is under Playback in pavucontrol?  Or if it isn't exclusive to MPlayer, is there any way to have all applications start at the 100% playback volume (not the output device volume)?
    EDIT: Quickly found it! Haha I had "softvol=yes" in my config file, I think to try to increase the Alsa volume when I had that on.  Thanks for your help anyway!
    Last edited by mellowmaroon (2013-04-14 05:25:24)

Maybe you are looking for

  • How to use moving maximum in query desighner

    Hi All, i am new to BI, please help. I have a requirement to find the maximum and minimum posting date for an article. For this i would need to use the moving maximum feature of the query. where to find this function and how to use it. please reply t

  • Illustrator extension - Drag and drop is not working on mac

    During testing my extension on Mac,I noticed that drag and drop doesn't work as expected. Therefore I have created a new simple extension with two lists. <s:List id="lst1" label="name" dragEnabled="true">      <tree>           <name>a</name>         

  • NAC OOB logoff feature not working

    Hi all, I've deployed NAC in L2 OOB VG mode with ADSSO and I'm trying to use the OOB logoff feature but it's not working. The VLAN change detect feature doesn't work either (I think the two problems might be related). It will work if each user role i

  • Do I remove CS6 to install CC apps?

    Could someone from Adobe please provide the relevant information, so that I can make an informed decision as to whether or not I need to keep CS6, or just replace it wth the CC apps. Are there any features which would only be retained by keeping CS6?

  • Why cant i delete itunes

    cant delete or install itunes