Solved

Playing Audio Using java in AU Format

Posted on 1997-09-25
6
692 Views
Last Modified: 2011-10-03
Dear sir,
We are involved in Developing Audio Conferencing system using Java.
Audio capture is achived using WINAPI calls (Java Native Methods) with
wave recording format as :

 waveformattag == WAVE_FORMAT_PCM
number of channels == 1
Bitspersample == 8
no. of samples per second = 8000
This audio sample is converted into .au format by adding header
information.
viz
struct {
int magic =  0x2E736E64;
    int dataLocation =24;
    int dataSize = filesize ;
    int dataFormat =2;
    int samplingRate =8000;
    int channelCount = 1;
}
 Playing audio is achived using audio.play method in JDK1.1.3   (& Sun
audio Package).
The problem is, the audio quality is diminished while playing using the
above mentioned method.
While it is good when done with Mutimedia Media Player(available with
WIN95).
Kindly let us know what is the underlined problem. Awaiting your reply.

Regards
ECS Development Team
DSQ s/w Ltd, Madras, India.

0
Comment
Question by:ecsdsq
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:gwalters
Comment Utility
You can't convert WAV to AU by adding a header.  WAV is PCM, and AU uses ULAW.
0
 

Author Comment

by:ecsdsq
Comment Utility
Thanks Gwalters for your immediate response. Actually we are struggling for recording the sound using ULAW only. But the SB16 of Creative Labs does not allow us to do so. So we are recording th raw samples in PCM format and then adding the 32 bit header corresponding to the .au format thinking that we will get the audio format. We would like to have more details about how to record in .au format with the SB16 of creative labs in the Windows-95 platform.
Expecting your fast response,

DSQ ECS team.
0
 
LVL 3

Expert Comment

by:gwalters
Comment Utility
Yes, that's where my limited knowlege ends.  I think you'll probably need to write/find a conversion program.

I used a program called "sox" (SOund eXchange), that converts almost any format to almost any other format.  Sox comes with source code, so you probably can port the appropriate parts to java (or just use it directly as native code).

0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 10

Accepted Solution

by:
kollegov earned 200 total points
Comment Utility
http://www.spies.com/Sox/
sox homepage.
sources available for download from here.
not bad idea to use sources, or even may be
to convert by single command in batch file

sox filename.wav filename.au

I used Goldwave to convert files when needed.
(windows 95 version)
0
 
LVL 10

Expert Comment

by:kollegov
Comment Utility
Found one more, which can be interesting to you:

http://www.scrawl.com/store/

SoundBite v1.0
Audio Recording/Playback in Java
using Native Methods (Windows 95/NT)
Shareware
0
 
LVL 10

Expert Comment

by:kollegov
Comment Utility
And ONE more exactly what you need!!!!
Wav2Au converts Microsoft .wav files to the .au format
 supported by Java. It reads mono or stereo, 8 or 16 bit,
 PCM-encoded files at any reasonable sampling rate,
 and writes the 8-bit, 8012 Hz sampling rate, mono,
 mu-law encoded files supported by Java. Full source
 code is included.
http://saturn.math.uaa.alaska.edu/~hursha
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

744 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

10 Experts available now in Live!

Get 1:1 Help Now