?
Solved

How is raw sound data stored?

Posted on 1997-05-26
5
Medium Priority
?
315 Views
Last Modified: 2013-12-26
I am using SPBRecord to create my own voice-activated recorder.  In order to do this i need to find some way to access the meter level (ie the volume level of the data - an integer from 0 to 255) from the raw data recorded into the buffer ( i think is sample points in the form integer -128 to 127).  How exactly is the sample data stored and how can i retrieve the volume level from this data?
0
Comment
Question by:DylanCranberry
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 

Author Comment

by:DylanCranberry
ID: 1291482
Adjusted points to 150
0
 

Author Comment

by:DylanCranberry
ID: 1291483
I guess what i really want to know is how do i read and manipulate individual samples.  Is there some code somewhere i can use to do this?
0
 

Author Comment

by:DylanCranberry
ID: 1291484
Adjusted points to 175
0
 
LVL 1

Expert Comment

by:byoung
ID: 1291485
audio is generally stored as byte arrays since these are the easiest to compress, manipulate, and store.  The exact encoding and decoding between recording and listening I don't know, the applications decipher the byte arrays.  You might be able to access it using Resedit or something liek that, but watch out cause you could screw something up royally with resedit.  good luck, hope this helps
0
 

Accepted Solution

by:
matthias072397 earned 510 total points
ID: 1291486
Hi,

every sample point is stored as either a signed or unsigned integer. This integer can have 8 or 16 bits. This depends on the sound, and I think you can tell SPBRecord whether you want 8 or 16 bits. More bits mean more quality. Sample data on the Macintosh is always unsigned, i.e. for example for 16 bit data, a sample point ranges between 0 and 65535. The "zero" point is at 32768.

If you want to determine the volume of raw sample data, you can try to add all sample points (convert to signed first by subtracting 32768 and take the absolute value!) and divide by the number of sample points. This gives you a "average" sample point that represents the volume - the higher the point the higher the volume.

Hope this helps.
Matthias
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question