The time now is Mon 23 Apr 2018, 19:03
All times are UTC - 4 |
Author |
Message |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Sun 11 Apr 2010, 16:01 Post subject:
|
|
Hola de nuevo amigos, walter, mi programa hace eso que quieres hacer, bueno no para el sonido que se corrio antes, pero eso seria caso de unas variables y ya, pero pues dices que segmentation fault, ya intentastes correrlo dandole click al binario?, asi si deberia de funcianar mi programa.
Aparte para lo que dices, gtk deberia de darte acceso a varios canales, y no estoy muy seguro de que lo haga, aunque si te diera una funcion para parar el sonido podria ser mucho mas facil de lo que crees, y pues para el teclado, creo que con la funcion scanf es mas que suficiente, saludos.
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
walter leonardo

Joined: 10 Dec 2009 Posts: 234
|
Posted: Sun 11 Apr 2010, 16:27 Post subject:
hola Subject description: hola |
|
lo primero que hice fue abrirlo aciendo click en el binario pero no paso nada y despues lo trate de ejecutar desde consola y me da ese error de segmentation fault.
bueno lo dices muy cencillo pero yo nose como hacerlo, estaria bueno que me pases esa funcion para frenar el sonido y como darles variables y usar ese scanf.
con un ejemplo ya me dare cuenta .Recien estoy en esto de gtk y me esta gustando mucho.
|
Back to top
|
|
 |
mister_electronico

Joined: 20 Jan 2008 Posts: 960 Location: Asturias_ España
|
Posted: Sun 11 Apr 2010, 16:57 Post subject:
que tal... |
|
Hola que tal goshujinsama ante todo no me ofendes para nada, lo que pasa es que no entiendo muy bien, lo que me quieres decir......
si tu te vas a home y pones delante del ejecutable organo.sh el puntero del raton y aprietas el boton derecho, y seleccionas open as text te sale lo siguiente:
#!/bin/sh
# Programa hecho por Angel Gutierrez.
# Para cualquiera que lo quiera utilizar.
# los sonidos pertenecen a Fernando Escutia Rodriguez
# de su programa teclado.
export script='
<vbox>
<button>
<label>Anamalaty</label>
<action>aplay /mnt/home/sounds/animalaty.wav</action>
</button>
<button>
<label>Babality</label>
<action>aplay /mnt/home/sounds/babality.wav</action>
</button>
<button>
<label>Ecxelen</label>
<action>aplay /mnt/home/sounds/ecxelen.wav</action>
</button>
<button>
<label>Fatality</label>
<action>aplay /mnt/home/sounds/fatality.wav</action>
</button>
<button>
<label>Its_that_your_best</label>
<action>aplay /mnt/home/sounds/its_that_your_best.wav</action>
</button>
<button>
<label>Finish_him</label>
<action>aplay /mnt/home/sounds/finish_him.wav</action>
</button>
<button>
<label>Toasty</label>
<action>aplay /mnt/home/sounds/toasty.wav</action>
</button>
<button>
<label>Well_done</label>
<action>aplay /mnt/home/sounds/Well_done.wav</action>
</button>
<button>
<label>Salir</label>
</button>
</vbox>'
gtkdialog3 -p script
Este programas es un script que le pasa los valores a gtkdialog3 y bueno en definitiva como veras todos los <action> de los botones busca los sonidos dentro del directorio /mnt/home/sounds. Pero esto lo puedes variar y poner vosotros la direccion que querais y poner los sonidos donde os de la gana.
Por supuesto que no me importa para nada que modifiqueis este programa, para eso esta para que hagais lo que querais y lo mejoreis y lo modifiqueis a vuestra conveniencia...... no se puede considerar un programa sino un ejemplo.
Un saludo y estoy aqui para cualquier consulta que me querais hace...
Saludos nos vemos.
|
Back to top
|
|
 |
walter leonardo

Joined: 10 Dec 2009 Posts: 234
|
Posted: Sun 11 Apr 2010, 17:01 Post subject:
hola Subject description: hola |
|
mister lo que el decia era hacer esto.
Code: | #!/bin/sh
# Programa hecho por Angel Gutierrez.
# Para cualquiera que lo quiera utilizar.
# los sonidos pertenecen a Fernando Escutia Rodriguez
# de su programa teclado.
export script='
<vbox>
<button>
<label>Anamalaty</label>
<action>aplay sounds/animalaty.wav</action>
</button>
<button>
<label>Babality</label>
<action>aplay sounds/babality.wav</action>
</button>
<button>
<label>Ecxelen</label>
<action>aplay sounds/ecxelen.wav</action>
</button>
<button>
<label>Fatality</label>
<action>aplay sounds/fatality.wav</action>
</button>
<button>
<label>Its_that_your_best</label>
<action>aplay sounds/its_that_your_best.wav</action>
</button>
<button>
<label>Finish_him</label>
<action>aplay sounds/finish_him.wav</action>
</button>
<button>
<label>Toasty</label>
<action>aplay sounds/toasty.wav</action>
</button>
<button>
<label>Well_done</label>
<action>aplay sounds/Well_done.wav</action>
</button>
<button>
<label>Salir</label>
</button>
</vbox>'
gtkdialog3 -p script |
|
Back to top
|
|
 |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Sun 11 Apr 2010, 17:05 Post subject:
hola Subject description: hola |
|
Hola de nuevo walter, que malo lo de mi programa, tal vez puede ser lo de los permisos, pero bueno, dejo de nuvo el archivo subido pero ahora tambien trae una compilacion static para ver si me hacen favor de checarlo y ver si ahora si corre, el binario a ejecutar es el Teclado-MK_sound_test01 y pues si pueden chequenlo de favor.
Y sobre el ejemplo, dejame y investigo un poco nas de gtk ya que no soy muy fluido en el, pero por lo que he visto tiene demasiadas similitudes con el c.
Description |
Teclado-MK_sound_test
|

Download |
Filename |
Teclado_MK_Sound_Test(v.2.0).tar.gz |
Filesize |
187.55 KB |
Downloaded |
622 Time(s) |
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
mister_electronico

Joined: 20 Jan 2008 Posts: 960 Location: Asturias_ España
|
Posted: Sun 11 Apr 2010, 17:21 Post subject:
Bien justo lo qu decia.. |
|
Walter esta bien, justo lo que te decia.... en mi caso mi instalacion es frugal y no me interesa colgar del directorio principal un directorio /sounds por que esto haria mas grande el archivo puppy - xxx.2fs.
Pero bueno como te dije lo podeis colocar en cualquier directorio.....
goshujinsama voy a intentar compilarlo y ejecutarlo y te cuento.......... Oye por cierto tu no esta utilizando puppy 431... puede ser que por ahi venga el problema de Segmentacion defaut no lo se...
Bueno te cuento...
Un saludo.
|
Back to top
|
|
 |
mister_electronico

Joined: 20 Jan 2008 Posts: 960 Location: Asturias_ España
|
Posted: Sun 11 Apr 2010, 17:51 Post subject:
Nada mas de los mismo. |
|
No me sigue el mismo problema he ejecutado los dos programas de tu tar. desde termial y desde con el puntero del mouse y el mismo error, lo he vuelto a compilar el programa que mandas pero mas de lo mismo....
Cuando lo compilo me da dos warning de *char te mando la imagen que me sale... nos vemos...... un saludo.
Description |
|

Download |
Filename |
imagen_1.png |
Filesize |
5.97 KB |
Downloaded |
702 Time(s) |
|
Back to top
|
|
 |
walter leonardo

Joined: 10 Dec 2009 Posts: 234
|
Posted: Sun 11 Apr 2010, 18:17 Post subject:
hola Subject description: hola |
|
Ami me pasa lo mismo con el programa chmsee me da error segmentation faul y cuando lo instalo en live-cd si anda bien pero le pongo las traducciones al español que tengo y ya no anda y me da error segmentation faul.
|
Back to top
|
|
 |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Mon 12 Apr 2010, 22:47 Post subject:
Hola Subject description: hola |
|
Mister esos warnings que te da a mi tambien me los da, y de echo si te genera el binario ejecutable, lo que estaba pensanco es que tal ves nuestros directorios difieren un poco, o tambien puede ser que no estemos usando el mismo gestor de ventanas, aunque eso seria raro, pero podria ser, yo uso icewm, igual y se debe a esto, no lo se, y todo esto es una lastima por que en realidad es una muy buena libreria esta, yo en mi caso no me rendire, tratare de encontrar el problema y a seguir trabajando con sdl.
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Mon 12 Apr 2010, 22:52 Post subject:
|
|
Bueno, en tu imagen mister vi que las librerias las tienes en local, por que no las copeas a /usr/lib, y las cabeceraz a /usr/include/SDL, pero primero nadamas con las librerias, por que creo que las cabeceras no deben de tener que ver en nada.
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Tue 13 Apr 2010, 11:21 Post subject:
GTK TUTO Subject description: turial gtk(en español) |
|
Bueno, pues he estado buscando un buen tuto de gtk, y por fin lo encontre, y lo mejor de todo en español; pero, a lo que ustedes llaman gtk no es gtk, sin ofender, les dejo un buen tuto de gtk, lo checan y me dicen que tal les parecio.
NOTA: Viene en formato html, el archivo principal es gtk_tut.es.html
Description |
Tutorial de gtk
|

Download |
Filename |
tutorial_gtk.tar.gz |
Filesize |
141.87 KB |
Downloaded |
600 Time(s) |
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
walter leonardo

Joined: 10 Dec 2009 Posts: 234
|
Posted: Sat 17 Apr 2010, 14:49 Post subject:
hola Subject description: hola |
|
hola muchachos.
Seria bueno que vallamos poniendo tutoriales en español asi aprendemos todos de todo un poco .
|
Back to top
|
|
 |
mister_electronico

Joined: 20 Jan 2008 Posts: 960 Location: Asturias_ España
|
Posted: Sun 18 Apr 2010, 09:46 Post subject:
Seria bueno |
|
Si seria bueno poner tutoriales como dices, creo tambien que seria bueno que se abries post independientes para cada uno de los lenguajes.. por ejemplo:
Un post para GTKdialog, otro post para lenguaje C, otro post para Scripts, otro post para SDL, otro post para GTK, etc....
Aunque los post fueran lentos, pero seria un sitio donde ir ordenando la informacion.
Saludos.
|
Back to top
|
|
 |
goshujinsama

Joined: 31 Mar 2010 Posts: 25 Location: MX
|
Posted: Mon 19 Apr 2010, 14:59 Post subject:
Hola Subject description: hola |
|
Bueno, pues estoy de acuerdo con esto de hacer distintos post, pero no me han dicho si ya les funciono sdl y ahorita es con lo que podria ayudar, saludos.
_________________ "The wise always keep an ear open to the whispers of power"-Diabolic Tutor

|
Back to top
|
|
 |
walter leonardo

Joined: 10 Dec 2009 Posts: 234
|
Posted: Fri 23 Apr 2010, 21:45 Post subject:
hola Subject description: hola |
|
hola.
Bueno vuelvo a la carga .
Encontré estos código en C,
1_es para reproducir sonidos con el teclado.
2_es para asignar un sonido a una tecla (este es mas sencillo).
1_
Code: | #include<lib.h>
#include<stdio.h>
void nuevo();
void abrir();
void gravar();
void caja(int modo, char msg[45], int y);
struct music
{
int grava0[530];
int grava1[530];
int grava2[530];
};
int cargado = 0;
int gravado = 0;
int abierto = 0;
char nombremus[9];
struct music datos;
main()
{
char resp;
int a, f, d, num;
int i, x, y, x2, y2, x3, y3, cont, cont2, gravando = 0, tec_esp = 0;
f = 10; d = 5000;
inicio:
textbackground(7);
clrscr();
textcolor(1);
cuadro(1,29,23,1,2);
cuadro(1,24,23,29,2);
cuadro(1,29,23,52,2);
gotoxy(1,8);
for (i = 1; i <= 29; i++)
cprintf("Ä");
gotoxy(1,8); cprintf("Ã");
gotoxy(29,8); cprintf("´");
textcolor(0);
gotoxy(10,8); cprintf("TECLAS");
gotoxy(3,10); cprintf("(A-Z, a-z) Sonidos");
gotoxy(3,11); cprintf("+ Aumentar frecuencia");
gotoxy(3,12); cprintf("- Disminir frecuencia");
gotoxy(3,13); cprintf("> Aumentar duraci¢n");
gotoxy(3,14); cprintf("< Disminuir duraci¢n");
gotoxy(3,15); cprintf("* Inicio/Detener gravaci¢n");
gotoxy(3,16); cprintf("/ Escuchar gravaci¢n");
gotoxy(3,17); cprintf("= Borrar pantalla");
gotoxy(3,19); cprintf("F2 Gravar");
gotoxy(3,20); cprintf("F3 Abrir");
gotoxy(3,21); cprintf("F4 Nuevo");
gotoxy(3,22); cprintf("ESC Salir");
if (abierto)
{
i = 0;
textcolor(0);
for (y = 3; datos.grava0[i] != '\f'; y++)
for (x = 53; x <= 80 && datos.grava0[i] != '\f'; x++)
{
gotoxy(x,y);
cprintf("%c", datos.grava0[i]);
i++;
}
}
cont = 0;
x = 30; y = 3;
if (!abierto)
{
num = cont2 = 0;
x2 = 53; y2 = 3;
for (i = 0; i < 530; i++)
datos.grava0[i] = datos.grava1[i] = datos.grava2[i] = 0;
}
do
{
textcolor(0);
gotoxy(10,2); cprintf("INFORMACION");
gotoxy(62,2); cprintf("GRAVACION");
if (cargado)
{
gotoxy(30,2);
cprintf("%s", nombremus);
}
gotoxy(3,3);
cprintf("Frecuencia: %d", f);
gotoxy(3,4);
cprintf("Duracion(seg): %d", d / 1000);
textcolor(4);
gotoxy(4,6);
if (gravando)
textcolor(-12);
else
textcolor(7);
cprintf("GRAVANDO");
textcolor(0);
gotoxy(x,y);
resp = getche();
if (resp == '\x0')
{
resp = getch();
tec_esp = 1;
}
else
if (gravando)
{
textcolor(0);
gotoxy(x2,y2); cprintf("%c", resp);
datos.grava0[cont2] = resp;
datos.grava1[cont2] = f;
datos.grava2[cont2] = d;
datos.grava0[cont2+1] = '\f';
cont2++;
x2++;
if (x2 == 80)
{
x2 = 53;
y2++;
}
}
if (!tec_esp)
{
switch (resp)
{
case '+': f += 10; break;
case '-': if (f > 10) f -= 10; break;
case '>': d += 1000; break;
case '<': d -= 1000; break;
case '*':
if (gravando) gravando = 0;
else gravando = 1;
break;
case '/':
x3 = 53; y3 = 3;
for (i = 0; i <= num+1; i++)
{
textbackground(3);
gotoxy(x3,y3); cprintf("%c", datos.grava0[i]);
if (datos.grava0[i] >= 65 && datos.grava0[i] <= 122 || datos.grava0[i] == 32)
{
a = datos.grava0[i] - 65;
a *= datos.grava1[i];
sound(a);
delay(datos.grava2[i]);
nosound();
}
textbackground(7);
gotoxy(x3,y3); cprintf("%c", datos.grava0[i]);
x3++;
if (x3 == 80)
{
x3 = 53;
y3++;
}
}
break;
case '=':
goto inicio;
default:
a = resp - 65;
a *= f;
sound(a);
delay(d);
nosound();
break;
}
x++;
cont++;
num++;
}
else
{
switch (resp)
{
case '<': gravar(); goto inicio;
case '=':
abrir();
num = cont2 = 0;
for (y2 = 3; y2 <= 20; y2 ++)
{
for (x2 = 53; x2 <= 81; x2++)
{
cont2++;
num++;
if (datos.grava0[cont2] == '\f')
break;
}
if (datos.grava0[cont2] == '\f')
break;
}
goto inicio;
case '>': nuevo(); goto inicio;
}
tec_esp = 0;
}
if (x == 51)
{
x = 30;
y ++;
}
if (y == 24)
goto inicio;
}
while (resp != 27);
}
void nuevo()
{
char resp;
if (gravado)
{
abierto = 0;
cargado = 0;
gravado = 0;
}
else
{
printf("\a");
caja(1,"Musica no Gravada",12);
caja(0,"¨Gravar ahora?",13);
resp = toupper(getche());
if (resp == 'S')
{
gravar();
abierto = 0;
cargado = 0;
gravado = 0;
}
else
return;
}
}
void abrir()
{
FILE *arch;
int i;
char resp,nombre[9];
nombre:
caja(1,"ABRIR",9);
caja(0,"Nombre del archivo:",10);
gotoxy(31,11);
textbackground(3);
strcpy(nombre,captura(8));
textbackground(7);
for (i = 0; i < strlen(nombre); i++)
if (nombre[i] == '.')
goto abrir_arch;
strcat(nombre,".mus");
abrir_arch:
if ((arch = fopen(nombre, "rb")) == NULL)
{
printf("\a");
caja(0,"No se encontr¢",12);
getche();
goto nombre;
}
nuevo();
for (i = 0; i < 530; i++)
datos.grava0[i] = datos.grava1[i] = datos.grava2[i] = 0;
fread(&datos, sizeof(struct music), 1, arch);
fclose(arch);
for (i = 0; i <= strlen(nombre); i++)
nombremus[i] = nombre[i];
cargado = gravado = abierto = 1;
}
void gravar()
{
int i;
FILE *arch;
char nombre[9], resp;
abierto = 1;
textcolor(4);
nombre:
caja(1, "GRAVAR", 9);
textcolor(1);
caja(0, "Nombre del archivo:", 10);
gotoxy(31,11);
textbackground(3);
strcpy(nombre,captura(8));
textbackground(7);
for (i = 0; i < strlen(nombre); i++)
if (nombre[i] == '.')
goto abrir_arch;
strcat(nombre,".mus");
abrir_arch:
if ((arch = fopen(nombre, "rb")) != NULL)
{
printf("\a");
caja(0,"Archivo ya existe",12);
caja(0,"¨Quieres",13);
caja(0,"sobrescribirlo?",14);
caja(0,"[S/N]:",15);
textbackground(3);
resp = toupper(getche());
textbackground(7);
if (resp == 'N')
goto nombre;
fclose(arch);
}
if ((arch = fopen(nombre, "wb")) == NULL)
{
printf("\a");
caja(0,"Error al tratar",12);
caja(0,"de abrir archivo.",13);
getche();
return;
}
fwrite(&datos, sizeof(struct music), 1, arch);
gravado = 1;
cargado = 1;
for (i = 0; i <= strlen(nombre); i++)
nombremus[i] = nombre[i];
fclose(arch);
}
void caja(int modo, char msg[45], int y)
{
int x;
if (modo == 1)
{
textcolor(0);
textbackground(4);
cuadro(2,22,10,30,8);
textcolor(3);
fondo(30,8,21,9);
}
x = (20-strlen(msg))/2+31;
gotoxy(x,y);
textcolor(1);
textbackground(3);
cprintf("%s", msg);
textbackground(7);
}
//Por Aurelio Márquez |
2_
Code: | #include <stdio.h>
#include <conio.h>
#include <dos.h>
#define N 500
void main(){
char x;
do{
x=getch();
sound(x*10);
delay(50);
nosound();
}while(x!=27);
} |
Les subo el programa para que lo analicen, usen, y si pueden lo compilen .
Description |
|

Download |
Filename |
sonido.zip |
Filesize |
245 Bytes |
Downloaded |
467 Time(s) |
Description |
|

Download |
Filename |
hamusica.zip |
Filesize |
3.03 KB |
Downloaded |
615 Time(s) |
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|