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
Solved

How is raw sound data stored?

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hibernate methods 2 77
VBA "SendKeys" Syntax for Multiple Keystrokes 7 117
changeXy challenge 13 88
Excel file not created as expected 7 79
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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