Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #3112 > unrolled thread
| Started by | achu.hegde19@gmail.com |
|---|---|
| First post | 2013-02-28 07:34 -0800 |
| Last post | 2013-03-01 02:33 -0600 |
| Articles | 5 — 5 participants |
Back to article view | Back to comp.programming
how to play mp3 using c programing achu.hegde19@gmail.com - 2013-02-28 07:34 -0800
Re: how to play mp3 using c programing Noob <root@127.0.0.1> - 2013-02-28 16:52 +0100
Re: how to play mp3 using c programing "osmium" <r124c4u102@comcast.net> - 2013-02-28 12:12 -0600
Re: how to play mp3 using c programing "BartC" <bc@freeuk.com> - 2013-02-28 20:34 +0000
Re: how to play mp3 using c programing Robert Wessel <robertwessel2@yahoo.com> - 2013-03-01 02:33 -0600
| From | achu.hegde19@gmail.com |
|---|---|
| Date | 2013-02-28 07:34 -0800 |
| Subject | how to play mp3 using c programing |
| Message-ID | <1e24a734-bde9-4fe4-aa70-8a741904c2f5@googlegroups.com> |
i mean if i press number 1 then enter it should play a mp3 tone.
[toc] | [next] | [standalone]
| From | Noob <root@127.0.0.1> |
|---|---|
| Date | 2013-02-28 16:52 +0100 |
| Message-ID | <kgnudt$u26$1@dont-email.me> |
| In reply to | #3112 |
achu.hegde19 wrote: > How to play mp3 using c programing ? > I mean if I press number 1 then enter it should play a mp3 tone. You'll have to define what an "mp3 tone" is.
[toc] | [prev] | [next] | [standalone]
| From | "osmium" <r124c4u102@comcast.net> |
|---|---|
| Date | 2013-02-28 12:12 -0600 |
| Message-ID | <ap9l07Ft2chU1@mid.individual.net> |
| In reply to | #3112 |
<achu.hegde19@gmail.com> wrote: > in message news:1e24a734-bde9-4fe4-aa70-8a741904c2f5@googlegroups.com... >i mean if i press number 1 then enter it should play a mp3 tone. I can't tell what it is you want to do. Try plugging mp3 exe into google and see if that leads you anywhere you want to go. If you want to personally write a program that reads an mp3 file and produces musical sounds from a speaker, you have a long road ahead of you.
[toc] | [prev] | [next] | [standalone]
| From | "BartC" <bc@freeuk.com> |
|---|---|
| Date | 2013-02-28 20:34 +0000 |
| Message-ID | <kgoev7$a7b$1@dont-email.me> |
| In reply to | #3112 |
<achu.hegde19@gmail.com> wrote in message
news:1e24a734-bde9-4fe4-aa70-8a741904c2f5@googlegroups.com...
> i mean if i press number 1 then enter it should play a mp3 tone.
This seems to work under Windows:
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
int main (void) {
printf("Press key:\n");
switch (getch()) {
case '1':
system("file.mp3");
break;
}
}
Provided it can find file.mp3 (which contains your tone). However the file
is played using an application chosen by the OS (eg. WMP).
If you want to get involved in audio file formats (MP3 is complex),
sound-card drivers and whatever, then there's a bit more to it. If you want
it portable, then there are even more things to take into account.
(Strangely, this is one of those things that were completely trivial 30
years ago on a home computer, that now seem, to me, next to impossible to do
for yourself on a modern PC.)
--
Bartc
[toc] | [prev] | [next] | [standalone]
| From | Robert Wessel <robertwessel2@yahoo.com> |
|---|---|
| Date | 2013-03-01 02:33 -0600 |
| Message-ID | <9ep0j816gl0b092g8ij4inlia2qstfipnc@4ax.com> |
| In reply to | #3118 |
On Thu, 28 Feb 2013 20:34:29 -0000, "BartC" <bc@freeuk.com> wrote:
>
><achu.hegde19@gmail.com> wrote in message
>news:1e24a734-bde9-4fe4-aa70-8a741904c2f5@googlegroups.com...
>> i mean if i press number 1 then enter it should play a mp3 tone.
>
>This seems to work under Windows:
>
>#include <stdio.h>
>#include <stdlib.h>
>#include <conio.h>
>
>int main (void) {
>
>printf("Press key:\n");
>
>switch (getch()) {
>case '1':
> system("file.mp3");
> break;
>}
>}
>
>Provided it can find file.mp3 (which contains your tone). However the file
>is played using an application chosen by the OS (eg. WMP).
More precisely, there's a mapping of file extension to command lines
related to individual actions in the registry. So you might have the
"Open" action for a .abc file map to "runabc %L", while the "Edit"
action might map to "notepad %L". For example, on my machine
.mp3/Open maps to "C:\Program Files\iTunes\iTunes.exe" /open "%L"
These mappings are not really defined by the OS (obviously a bunch
come predefined), but are usually added or modified (by the installer)
when an application is installed that handles that file type.
You can modify them yourself if you like via My Computer/Tools/Folder
Options/File Types (the non-Open actions are under the Advanced
button), or via the registry entries directly.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web