Solved

/dev/audio

Posted on 2001-07-18
6
529 Views
Last Modified: 2013-12-06
This is more of a survey than a question. I need to know how reliable it is to use /dev/audio to play sound on unix machines. The actual deal is that I need sound in a java JDK 1.1 compatible application, and there is no Java API in 1.1 to do that. What I think I will do is simply open /dev/audio as a file and write into it. The main question is what percentage of unix machines have this configured correctly. Please take the 30 seconds needed to check this and tell me if it works on your unix box. 5 points per answer, please don't lie :-)

The command to try is "cat somemusicfile.au > /dev/audio" (it's important for me that it's an 'au' file).

Thanks,
Sasha Maryanovsky.
0
Comment
Question by:Sasha_Mapa
  • 3
  • 3
6 Comments
 
LVL 14

Accepted Solution

by:
chris_calabrese earned 50 total points
ID: 6296041
/dev/audio is a sun-ism.  Though it's been picked up by some other *x vendors, still other *x flavors do things differently (and hence the need to standardize things in the Java VM).

For example, in HP-UX you'd use
/opt/audio/bin/send_audio -au <filename>
0
 
LVL 7

Author Comment

by:Sasha_Mapa
ID: 6297075
Well, what's mostly important to me is the percentage - I'm not writing a professional application, and if 90% of the users will have a correct setting, I have no problem asking the remaining 10% to symlink /dev/audio to their actual audio device.

Sasha Maryanovsky.
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6298287
But, but, but, my point is that many Unix systems have no audio device.  HP-UX in particular does not, and it represents ~30% of Unix sales by revenue (so at least 10% of sales by volume).
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 7

Author Comment

by:Sasha_Mapa
ID: 6298325
Forgive me if I'm saying stupid things here (I'm not a unix guy), but if HP-UX has no audio device, why'd you say I would use "/opt/audio/bin/send_audio -au <filename>" on an HP-UX?

Anyway, I don't really care about machines that have no audio device at all... it means they can't produce sound (right?), so my method which plays the sound will just fail - no problem.

Sasha Maryanovsky.
0
 
LVL 14

Expert Comment

by:chris_calabrese
ID: 6298388
It does have an audio capability, but it's not presented as a filesystem-based device as in Solaris.  Instead there are audio-specific system calls to talk to the audio device.
0
 
LVL 7

Author Comment

by:Sasha_Mapa
ID: 6857179
Sorry, it took so long.

Alexander Maryanovsky.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
what is the meaning of filesystem loop detected? 7 1,058
sudo logging 5 93
removing nim resources 5 54
Cygwin VIM in WIndows 2007: Unable to copy text to Windows 10 65
Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

778 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