Programming :: Using "aplay" To Play Notifications In C Program?
Oct 21, 2010
I am looking to play a simple sound effect as an event notification in a C program I am working on, but want to do it as simply and easily as possible. Portability is of no concern (this is a Linux-only application) nor is the format of the audio file (the file will be bundled with the application, so I can make the format whatever is necessary).The simplest way seems to be just calling "aplay" from within my program, but I am not sure if this is really a safe approach or not. Is this is a reasonable enough solution for a simple task like this? Other than the program not existing on the host OS (which obviously I would check for on execution), are there any other pitfalls?
View 6 Replies
ADVERTISEMENT
Jan 28, 2010
My audio is working on my recent koala install. System wav files play without a problem.
However, when I open a terminal to play my own wav files I get an error. (I encountered this problem merely by trying to setup an incoming mail notification with CheckGmail....)
The command: aplay /home/saskms/Music/test.wav
The error: aplay: test_wavefile:807: can't play WAVE-file format 0x0002 which is not PCM or FLOAT encoded
I think I have installed all the necessary gstreamer options. I am guessing that maybe I just need to re-rip the WAV file into a different format. I also tried doing searches on the error, but yielded no results.
View 5 Replies
View Related
Feb 15, 2011
I will have to code this. However I am lacking of time since I have too much to do. make a short code bash/dash to prompt the country with Zenity, then, get the PLS or m3u url and prompt with another zenity which radio to play. http://www.listenlive.eu/index.html
My code to get url's radio country.htm is:
Code:
View 2 Replies
View Related
Jan 25, 2011
Normally i use "arecord" to capture and dump in a file (.wav). If i want to play the file then i use "aplay". But, is it possible that, insted of capturing to a file and then playing the file offline, if i want to play it realtime
View 1 Replies
View Related
Feb 17, 2010
I know I've probably should've searched a little harder than what I already did but... If evolution mail is closed, I get no notifications... How can I minimize this to the tray, or have the notifications show even with the program closed?
View 7 Replies
View Related
Jan 18, 2010
I have those notifications bubbles that appear right and top of my Screen.
Besides being RIDICULOUSLY big, i don't need them
I don't know if it is the same, but they look like this:
NOTE THIS PICTURE IS JUST AN EXAMPLE I FOUND ON THE INTERNETS - I WANT TO DISABLE ALL NOTIFICATIONS
View 14 Replies
View Related
Apr 11, 2011
I am looking for a DJ program to use with this OS. I am look for a program like virtual dj to use that will play mp3's. I have seen some programs that will play music, not able to find a song as I have 1,000's of them. So far I have seen ubuntu looks very promising.
View 2 Replies
View Related
Aug 11, 2011
i've installed ubuntu studio on my old pc and it's barely working. (sorry for my language) when i put on player to play a song everything is ok but when i try to make an other program to play sound it doesnt... i saw about the jack server but i can't unterstand what am i suposed to do. the programs that succsessfully play sound are: media player, chrome, mozilla, some games.
View 6 Replies
View Related
Jan 15, 2010
Ok so Basically i have 2 questions
1. i know how to create a file with c++ using but is there a way to save it to a specific location on your computer with windows and linux
Code:
2. i need to know how to run/execute/open a file in a c++ program im using and its not working
Code:
View 4 Replies
View Related
Jul 18, 2010
I've got a new machine with an Nvidia GeForce 210 graphics card with HDMI output. I'm trying to get sound to go out that HDMI cable, but although the device shows up on lspci, I can't get it acknowledged by aplay -l, which lists the audio devices known to the audio driver.
lspci shows (in part): 00:14.2 Audio device: ATI Technologies Inc SBx00 Azalia (Intel HDA)01:00.1 Audio device: nVidia Corporation High Definition Audio Controller (rev a1) The first is the motherboard audio, and it works fine. The second (I assume) is the graphics card with HDMI. But aplay -l lists only the motherboard analog and S/PDIF outputs:
[Code]...
I can't see how I'm going to select a device that the drivers think isn't there. how to make that device visible to the sound drivers? I'm running Ubuntu 10.04 with a 2.6.32 stock kernel. The Nvidia driver version is 195.36.24.
View 1 Replies
View Related
Aug 10, 2010
After solving the problems:
- HDMI device not recognized in aplay -l
- upgrading Alsa to 1.0.23
- multiple HDMI devices installed
I now have an ubuntu laptop where
1) aplay -l outputs
[Code]...
View 2 Replies
View Related
Mar 6, 2011
I'm an Ubuntu newbie here, and I recently bought an ASUS N53JF-XE1 laptop, and after a new installation of Ubuntu 10.10, I don't seem to be able to get the sound working (neither from speakers, nor from headphones). I've been searching a lot of places, and with no luck and a lot of frustration, I'm coming here for a possible solution! According to "lspci -v", this is the info for my sound card:
Code:
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
Subsystem: ASUSTeK Computer Inc. Device 1113
Flags: bus master, fast devsel, latency 0, IRQ 3
Memory at d9c00000 (64-bit, non-prefetchable) [size=16K]
Capabilities: <access denied>
Using "aplay -l" gives me this:
Code: aplay: device_list:235: no soundcards found... It seems to me that I'm somehow missing the drivers for my sound card. However, I don't know where to find the correct drivers or how to install them. I've been all over the alsa-project website, and I can't find anything useful.
View 2 Replies
View Related
Nov 20, 2010
which program can play divx with XSUB subtitle? I've tried movie play and VLC ! didn't work?
View 1 Replies
View Related
May 20, 2011
I start play on linux to use ms office this message keeps popping up before it. Is anything wrong or should be done
View 8 Replies
View Related
Sep 21, 2011
I have ALSA on Ubuntu 11.04 version.
When I play aplay through my normal user, I am able to get the output.
When I do this with the root user, the command hangs: below stuff happens
root@myuser:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
(hangs)
Also if I export the $HOME to /home/myuser/ then it works. So whats wrong for running the aplay command with a root.
View 1 Replies
View Related
Feb 4, 2011
I installed Xubuntu to a flashdrive using unetbootin. Since I only have a 2GB drive I installed Fluxbox instead of XFCE to save space. I install alsa-utils to try to get some audio going. aplay and speaker-test gets nothing at all. Both as sudo and a reg user. I have turn up the volume on everything in alsamixer. I believe the relevant drivers are loaded.
Code:
View 1 Replies
View Related
Feb 26, 2011
I lost sound after restarting, I had sound, then on my reboot... No sound. I tried to google the problem and ran the common tasks of removing and re-installing "alsa-base" and "pulseaudio" using apt-get in terminal. But after trying all this I have now lost the volume control at the top right of my screen I have no idea what the issue is, in System > Preferences > Sound I get nothing under Hardware, nothing under Input, "Dummy Output" under Output, and nothing special under Applications. Here is the results of commands in terminal which I have commonly see people been asked to do:
Code:
sudo aplay -l
aplay: device_list:235: no soundcards found...
Code:
sudo find /lib/modules/`uname -r` | grep snd
/lib/modules/2.6.35-22-generic/updates/dkms/snd-hda-codec-idt.ko
/lib/modules/2.6.35-22-generic/updates/dkms/snd-hda-codec.ko
[code]....
The only thing I think that could of triggered everything to mess up is some mods I made to to the alsa-base.conf file - What I did to it I can't remember, But I have tried to remove these two lines of code at the end of it, saved it, restarted my computer and still no audio. I am using Ubuntu 10.10 (Maverick) 64Bit Kernel Linux 2.6.35-22-Generic GNOME 2.32.0
View 1 Replies
View Related
Oct 25, 2010
I'm running Fedora 12 and at some point about a year ago my ALSA just stopped working. After posts, trials, etc, no joy. Now, after a few more months, and further F12 updates, I'm trying to get back to it.I have:
Code:
[root@DadPC ~]# cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.21.
[code]....
View 2 Replies
View Related
Dec 15, 2010
My sound was working quite fine with Fedora 13 (Internal Audio) until I decided that I want to install the appropriate driver from the vendor's website.
[Code]...
View 2 Replies
View Related
Apr 4, 2011
I have had on and off problems with my sound for quite some time now. Each time it would stop working, I would find a fix which would work for a month or so, then I would go back to having no sound. I have had consistent sound on my Windows partition, so I don't think something is wrong with the hardware. The first fix I used was using "sudo alsa force-reload" to get ALSA working again. The latest fix I used was to add the line "options snd-hda-intel model=toshiba" to alsa-base.conf, which worked up until now. My built-in computer speakers won't make any sound, nor will my external monitors when they are plugged into the headphone jack. I do get sound when I plug in a pair of USB headphones.
I have tried using the Comprehensive Sound Problem Solution Guide [url], but I run into a predicament...
aplay -l (with or without being root) gives...
Code:
Code:
Alsamixer isn't much help either. It shows the name of my card in the top left, but there are no sliders to adjust.
I've tried compiling the modules from source, reinstalling through Synaptic, and plenty of other things, to no avail. Ubuntu 10.04 on a Toshiba Satellite U305-S5107
View 9 Replies
View Related
Feb 12, 2011
im trying to build a simple program for my C programming class, this is the source code
#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;
[Code]...
i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?
View 5 Replies
View Related
Dec 28, 2010
Is it possible to play flash without flash-player installed? I heard that SWF file and flash player itself may be included into one EXE file.
View 3 Replies
View Related
May 5, 2010
I am trying to play with calling text files in C. What I have is a text file with 4 columns of numbers I need to average 2 of them. I have started and hit a wall. I have the following so far:
[Code]....
I still need to figure out how to read the data in. I have been reading on this for a few hours and its not clicking. How does the program know which columns with names to call. the data is organized: ID, Day, Speed, Temp.
View 6 Replies
View Related
Jan 6, 2011
from the php or html webpages pages, can we find the direct link to the flv files. videos it is easy, ok, because it places with firefox the flv file into the temp. but what about all other streams of webcams, videos, music, ... so that one can use mplayer
View 1 Replies
View Related
Aug 23, 2013
Code handy which could play a beep/alert sound when somebody (any user) joins your LAN. Or as second-hand choice, if this is too hard, to play a beep when X terminal windows writes some output lines.
View 2 Replies
View Related
Jul 31, 2010
I'm having trouble getting ALSA to play multiple sound streams (multiple sounds at once). My code is running on an embedded ARM board using a AC97 sound. It will only play one without any mixing, I have to use pure ALSA as higher sound mixers are a nightmare to cross compile for ARM. I've tested my system with aplay for example
aplay -D plughw:0,1 bang.wav
works fine. So I tried dmix with
aplay -D plug:dmix Win.wav
That gave the following error
ALSA lib pcm_direct.c:1587snd_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio)
aplay: main:550: audio open error: Invalid argument
I checked asound with
/etc # cat asound.conf
pcm.EP93XX {
type hw
[code]....
Does this mean dmix will not work? Is there someway with the above setup I can play multiple sounds? I have to use the vendor ALSA build (so can't update ALSA), I can change the .confs however. Also because I'm cross compiling things like pulseaudio SDL are very difficult to get working, so I basically need to use the above ALSA. Is there anyway I can find if dmix exists on the system?
Should add aplay -L does show dmix ?
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
[code]....
View 3 Replies
View Related
Feb 5, 2009
I found some interesting behavior when discussing the pow function from Math.h with someone. I am well aware of the need to compile with the -lm flag, but to my surprise this actually isn't necessary if the arguments to the pow function are literals. For example, this program compiles in gcc without using -lm:
Code:
#include <stdio.h>
#include <math.h>
int main()
[code]....
If I try to change the call to any of these:
Code:
double bCubed = pow(2.0, e);
Code:
double bCubed = pow(b, 3.0);
Code:
double bCubed = pow(b, e);
Then the -lm option is required or else it can't compile. So does anyone know why it's necessary to use -lm when the argument(s) is/are variable(s) but it works fine if both arguments are literal values? As a side note, any of the above compile with g++ however. Also, if it helps, this is the version of gcc I'm using:
gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44)
This doesn't happen on my Mac however that is running: i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5484)
View 3 Replies
View Related
May 23, 2009
I am new to linux/c programming and I am trying to get TTY id from my c program. Something like this:
int TTYID = get_ttyid();
How do I do that?
View 1 Replies
View Related
Jul 4, 2011
I'm trying to write a script that will either tail or watch /var/log/messages for the words
PHP Code:
signal Gone into alarm state
From this line below.
I would then like the script execute:
And have run at start up.
I'm stuck with grep-ping only one word
PHP Code:
View 14 Replies
View Related
Mar 15, 2011
The following is the error in my program :
Here is my program...
View 7 Replies
View Related