mirror of
https://github.com/QB64-Phoenix-Edition/QB64pe.git
synced 2024-07-06 18:40:23 +00:00
Add tests for _NEWSOUND and _SNDOPEN
This commit is contained in:
parent
4c80f6bcea
commit
31257262a8
14
tests/compile_tests/audio_mem_test/newsound_test.bas
Normal file
14
tests/compile_tests/audio_mem_test/newsound_test.bas
Normal file
|
@ -0,0 +1,14 @@
|
|||
$Console:Only
|
||||
Option _Explicit
|
||||
Option _ExplicitArray
|
||||
|
||||
Dim h As Long: h = _NewSound(1024, 2, 32)
|
||||
Print "Handle ="; h
|
||||
|
||||
Dim m As _MEM: m = _MemSound(h, 0)
|
||||
Print "Size ="; m.SIZE
|
||||
Print "Type ="; m.TYPE
|
||||
Print "Element Size ="; m.ELEMENTSIZE
|
||||
Print "Sound ="; m.SOUND
|
||||
|
||||
System
|
5
tests/compile_tests/audio_mem_test/newsound_test.output
Normal file
5
tests/compile_tests/audio_mem_test/newsound_test.output
Normal file
|
@ -0,0 +1,5 @@
|
|||
Handle = 1
|
||||
Size = 8192
|
||||
Type = 260
|
||||
Element Size = 8
|
||||
Sound = 1
|
17
tests/compile_tests/audio_mem_test/sndopen_mem_test.bas
Normal file
17
tests/compile_tests/audio_mem_test/sndopen_mem_test.bas
Normal file
|
@ -0,0 +1,17 @@
|
|||
$Console:Only
|
||||
Option _Explicit
|
||||
Option _ExplicitArray
|
||||
|
||||
Dim f As Long: f = FreeFile
|
||||
Open "test.mp3" For Binary Access Read As f
|
||||
|
||||
Dim buffer As String: buffer = Input$(LOF(f), f)
|
||||
Print "Size ="; Len(buffer)
|
||||
|
||||
Close f
|
||||
|
||||
Dim h As Long: h = _SndOpen(buffer, "memory")
|
||||
Print "Handle ="; h
|
||||
|
||||
System
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Size = 42018
|
||||
Handle = 1
|
BIN
tests/compile_tests/audio_mem_test/test.mp3
Normal file
BIN
tests/compile_tests/audio_mem_test/test.mp3
Normal file
Binary file not shown.
Loading…
Reference in a new issue