Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8166963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T20:03:39+00:00 2026-06-06T20:03:39+00:00

I have an array of raw sound data samples, and I’m trying to make

  • 0

I have an array of raw sound data samples, and I’m trying to make a graphical player that displays the waveform along with the progress of the audio as it plays.

I can plot it easily enough with matplotlib, and I can play it with audiolab, but audiolab appears to have no way to get the “current location” of the playhead.

Are there any modules capable of doing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T20:03:40+00:00Added an answer on June 6, 2026 at 8:03 pm

    If you know the number of audio frames, and the samplerate, you don’t need to audiolab to tell you the current location, you can compute it.

    Sndfile.frames / Sndfile.samplerate will give you the duration of the file in seconds, you can then use this in conjunction with elapsed time since since sound file start to compute relative current location. To illustrate the principle:

    import time
    
    start_time = time.time()
    duration_s = sndfile.frames / sndfile.samplerate
    
    while 1:
        elapsed_time = time.time() - start_time
        current_location = elapsed_time / float(duration_s)
        if current_location >= 1:
             break
        time.sleep(.01)
    

    To implement this in practice, you could use Python threading, to play the sound file asynchronously, and then compute the current location (as above) in the parent thread. To handle the case where playback fails, wrap your call to scikits.audiolab.play() in an exception handler, and then use threading.Event to pass an event to the parent thread if/when the play() call fails.

    In the parent thread you would then need to check event.isSet() accordingly:

    if current_location >= 1 or fail_event.isSet():
        break
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have flv files that contain audio tags with a aac raw data. Each
I have a list of bytes that represent raw samples read in from an
I have raw data in a custom image format (canot be changed) that is
I have a raw pointer which points to an array of data. I would
I have some audio data (raw AAC) inside a byte array for playback. During
I have raw 44,1 kHz audio data from a song as Javascript array and
I have dynamic array filled with bytes, which are read from .raw file with
I have array of strings, String[] data and it's 10 elements has value P
I have a 2D array of integers that represent groupings (crystal grains) on a
I'm trying to encode raw pcm data as uLaw to save on the bandwidth

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.