Solved

How is raw sound data stored?

Posted on 1997-05-26
5
295 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
  • 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 170 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now