bugGNU Octave - Bugs: bug #50315, audioplayer.play stops playback...

 
 

bug #50315: audioplayer.play stops playback before end of input array

Submitted by:  Georg Wiora <gwiora>
Submitted on:  Wed Feb 15 15:03:02 2017  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: ConfirmedAssigned to: None
Originator Name: gwioraOpen/Closed: Open
Release: 4.2.0Operating System: Microsoft Windows

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed Feb 15 22:02:52 2017, comment #2:

I can confirm something similar on Debian. Using your examples of tones at a sample rate of 8 kHz, the second tone is not played at all if it is about 150 ms or less in duration.

Since sound() is just a wrapper around the audioplayer class, here is an example that shows the same behavior for me using audioplayer.play directly:

The truncation may be in the way Octave is feeding data to portaudio or it may be in the portaudio library or in a lower layer. It should be possible to debug the portaudio interaction in audiodevinfo.cc to see what conditions cause the audio stream to stop, and whether Octave needs to make an additional call to flush remaining data for example.

Mike Miller <mtmiller>
Project Administrator
Wed Feb 15 15:04:58 2017, comment #1:

P.S.: If you think it is worth to include you may add the beepcode() function to future releases of octave.

Georg Wiora <gwiora>
Wed Feb 15 15:03:02 2017, original submission:

The sound function seems to stop the sound playback too early. This shows up espacially with short sounds below one second. I guess that the sound length is shortened by around 200 milliseconds.

Attached there is a small function for creating configurable beep patterns. It is suitable for testing this behavior. See inline documentation for usage.

The following call should play two short beeps a lower and a higher one. The second beep in the example is not played on my windows system:
When adding a time of silence to the end of the beep sequence the second beep is played depending on the length of silence:

Georg Wiora <gwiora>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #39761:  beepcode.m added by gwiora (1kB - application/octet-stream - Sample function to play beeps.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by gwiora (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Feb 15 22:02:52 2017mtmillerStatusNone=>Confirmed
      Summarysound() function stops playback too early=>audioplayer.play stops playback before end of input array
    Wed Feb 15 15:03:02 2017gwioraAttached File-=>Added beepcode.m, #39761

    Back to the top


    Powered by Savane 3.1-cleanup1