Solved

How is raw sound data stored?

Posted on 1997-05-26
5
297 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 172
matchUp  challenge 6 53
zeroMAx challenge 20 87
changeXy challenge 13 67
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

910 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

15 Experts available now in Live!

Get 1:1 Help Now