![]() OUTB 0x22C, 0x00 mono and unsigned sound data OUTB 0x0A, 1 enable channel 1 program sound blaster 16 OUTB 0x03, 0x0F COUNT HIGH BIT (EXAMPLE 0x0FFF) - SET THIS VALUE FOR YOU OUTB 0x03, 0xFF COUNT LOW BIT (EXAMPLE 0x0FFF) - SET THIS VALUE FOR YOU OUTB 0x02, 0x0F POSITON HIGH BIT (EXAMPLE POSITION IN MEMORY 0x0104) - SET THIS VALUE FOR YOU OUTB 0x02, 0x04 POSITION LOW BIT (EXAMPLE POSITION IN MEMORY 0x010F) - SET THIS VALUE FOR YOU OUTB 0x83, 0x01 PAGE TRANSFER (EXAMPLE POSITION IN MEMORY 0x0F04) - SET THIS VALUE FOR YOU OUTB 0x0A, 5 disable channel 1 (number of channel + 0x04) OUTB 0x226, 0 reset port turn speaker on OUTB 0x226, 1 reset port mov ah, 86h mov cx, 0x0000 mov dx, 0xFFFF int 15h wait SOUND BLASTER 16 driver in real mode reset sound blaster % macro INB 1 mov dx, %1 in al, dx %endmacro % macro OUTB 2 mov dx, %1 mov al, % 2 out dx, al %endmacro if is your real length 0x0FFF, you must send 0xFE and 0x0F) Write data length to DSP(Low byte/High byte) (You must calculate LENGTH-1 e.g.You can calculate the time constant like this: Time constant = 65536 - (256000000 / (channels * sampling rate)) Notice that the Sound Blaster 16 is able to use sample rates instead of time constants using command 0x41 instead of 0x40. You must write type of sound data after write transfer mode. Usually values are 0xB0 for 16 bit playing sound or 0xC0 for 8 bit playing sound. Enable channel by writing channel number to port 0xD4.Send high bits of length of data to port 0xC6(count port of channel 5) For example if is length 0x0FFF, send 0x0F. ![]()
0 Comments
Leave a Reply. |