Llamar a "speakers" en C.

Iniciado por krebakabezas, 4 Octubre 2011, 19:31 PM

0 Miembros y 1 Visitante están viendo este tema.

krebakabezas


Estoy intentando crear un programa en C que llame a los speakers y reproduzca una canción. He buscado en Google y he visto que se puede hacer con la libreria "windows.h" y llamando a la función "Beep". Pero al usarla no me llama a los speakers sino que utiliza los altavoces.
¿Hay alguna librería que me permita llamar a los speakers directamente?
PD:Utilizo windows 7.
PDD: Este es el codigo del programa.
#include <stdio.h>
#include <windows.h>

main()
{
Sleep (250);
Beep(293,250);
Beep(311,250);
Beep(392,250);
Beep(369,250);
Beep(392,250);
Beep(369,250);
Beep(349,250);
Beep(369,250);
Beep(554,1000);
Beep(466,1000);
Beep(392,1500);
Sleep(250);
Beep(392,250);
Beep(466,250);
Beep(554,250);
Beep(658,750);
Beep(622,1250);

getchar();
}



El_Java

Perdon por mi ignorancia, pero cuando te refieres a "speakers" a que te refieres? :S
http://translate.google.com/#en|es|speakers

krebakabezas


Eternal Idol

Beep:

Remarks

A long time ago, all PC computers shared a common 8254 programable interval timer chip for the generation of primitive sounds. The Beep function was written specifically to emit a beep on that piece of hardware.

On these older systems, muting and volume controls have no effect on Beep; you would still hear the tone. To silence the tone, you used the following commands:

net stop beep

sc config beep start= disabled

Since then, sound cards have become standard equipment on almost all PC computers. As sound cards became more common, manufacturers began to remove the old timer chip from computers. The chips were also excluded from the design of server computers. The result is that Beep did not work on all computers without the chip. This was okay because most developers had moved on to calling the MessageBeep function that uses whatever is the default sound device instead of the 8254 chip.

Eventually because of the lack of hardware to communicate with, support for Beep was dropped in Windows Vista and Windows XP 64-Bit Edition.

In Windows 7, Beep was rewritten to pass the beep to the default sound device for the session. This is normally the sound card, except when run under Terminal Services, in which case the beep is rendered on the client.
La economía nunca ha sido libre: o la controla el Estado en beneficio del Pueblo o lo hacen los grandes consorcios en perjuicio de éste.
Juan Domingo Perón

krebakabezas

Gracias por la respuesta, no sabía que no funcionaba en win7. Ya lo probaré en un Pentium MMX.
Salu2.

Eternal Idol

De nadas, funciona pero usando la placa de sonido.
La economía nunca ha sido libre: o la controla el Estado en beneficio del Pueblo o lo hacen los grandes consorcios en perjuicio de éste.
Juan Domingo Perón