linux - Music with assembler - /dev/dsp in pulseaudio? -


i want make "music" or better output little "beep" assembler program:

play.s:

datei: .ascii "/dev/dsp"  .globl play play: movl $5, %eax movl $datei, %ebx movl $1, %ecx int $0x80 pushl %eax movl %eax, %ebx movl $4, %eax movl 12(%esp), %ecx movl 8(%esp), %edx int $0x80 

music.s:

.globl _start #.lcomm buffer, 100 buffer: .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 .byte 0,255,0,255,0,255,0,255,0,255 _start: pushl $buffer pushl $100 loop: call play jmp loop movl $1, %eax movl $0, %ebx int $128 

i assemblered both with:

as music.s -o music.o play.s -o play.o

and linked both with:

ld play.o music.o -o music

but registered not have "/dev/dsp"-file. so there similiar /dev/dsp in pulseaudio?

the legacy /dev/dsp interface not enabled default.

to emulate it, try padsp (included pulseaudio), or osspd.

alternatively, output sample data stdout , pipe aplay.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -