Solved

Playing Audio Using java in AU Format

Posted on 1997-09-25
6
701 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
[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
  • 2
6 Comments
 
LVL 3

Expert Comment

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

Author Comment

by:ecsdsq
ID: 1227462
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
ID: 1227463
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 10

Accepted Solution

by:
kollegov earned 200 total points
ID: 1227464
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
ID: 1227465
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
ID: 1227466
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Suggested Courses

628 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