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

  • Home
  • SEARCH
  • 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 1068553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:18:10+00:00 2026-05-16T20:18:10+00:00

I’m trying to sort the difference between Sound.readData and Sound.lock in the FMOD library

  • 0

I’m trying to sort the difference between Sound.readData and Sound.lock in the FMOD library (I’m programming in C#/C++ but I’ll take the answer in any language!). The end goal is to create a view of the waveform, which I understand cannot be done (easily) with Channel.getWaveData.

I have been able to get both the Sound.readData and Sound.lock approach to return the same data with createStream and createSound, respectively (not sure if it’s valid – e.g. decoded – data yet) . I’d like to use the stream approach if possible to minimize memory footprint but I’m not really sure what it is that I’m reading now and the documentation isn’t entirely clear.

  • 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-05-16T20:18:10+00:00Added an answer on May 16, 2026 at 8:18 pm

    Essentially the difference between the two is what you are accessing.

    With Sound::lock you are locking the sample buffer of the sound, so when you load with createSound it decompressed the file to PCM and puts it in the sample buffer. You use this function to directly access that buffer (you lock the portion of it you want). If you are on a console that data may be a native compressed format. As a side note the idea of “locking” a sound comes for the DirectSound API where you would “lock” a buffer to prevent access to it while you read from or write to it, when you are done you unlock given access back to the audio system.

    Sound::readData is a more gradual way to pull (stream) PCM data out of the sound, here you are actually decoding the compressed data to PCM with each readData call. You do this in smaller blocks and you always get the final decoded PCM data. This approach is more flexible and memory efficient.

    For example you could load a 10MB MP3 as a stream then decode it to PCM using Sound::readData in chunks. Otherwise you would need to load it as a sample (which decodes it to PCM at createSound time) then lock a massive buffer to get the PCM.

    getWaveData is used for displaying the waveform at the current time of playback, it should not be used to decode a complete waveform of the file. Depending on the frequency of calls to getWaveData, you may get the same block of data multiple times as it’s a single snapshot in time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.