Browse Source

Added some externs to stb-vorbis.

Mark Sibly 7 years ago
parent
commit
16f366d85d
1 changed files with 30 additions and 10 deletions
  1. 30 10
      modules/stb-vorbis/stb-vorbis.monkey2

+ 30 - 10
modules/stb-vorbis/stb-vorbis.monkey2

@@ -8,15 +8,35 @@ Namespace stb.vorbis
 
 
 Extern
 Extern
 
 
-#rem
-
-extern int stb_vorbis_decode_memory(const unsigned char *mem, int len, int *channels, int *sample_rate, short **output);
-
-// decode an entire file and output the data interleaved into a malloc()ed
-// buffer stored in *output. The return value is the number of samples
-// decoded, or -1 if the file could not be opened or was not an ogg vorbis file.
-// When you're done with it, just free() the pointer returned in *output.
-
-#end
+Struct stb_vorbis
+End
+
+Struct stb_vorbis_alloc
+End
+
+Struct stb_vorbis_info
+	
+	Field sample_rate:UInt
+	Field channels:Int
+
+	Field setup_memory_required:UInt
+	Field setup_temp_memory_required:UInt
+	Field temp_memory_required:UInt
+
+	Field max_frame_size:Int
+End
+
+Function stb_vorbis_open_filename:stb_vorbis Ptr( filename:CString,error:Int Ptr,alloc_buffer:stb_vorbis_alloc Ptr )
+Function stb_vorbis_open_file:stb_vorbis Ptr( f:libc.FILE Ptr,close_handle_on_close:Int,error:Int Ptr,alloc_buffer:stb_vorbis_alloc Ptr )
+	
+Function stb_vorbis_close( f:stb_vorbis Ptr )
+
+Function stb_vorbis_get_info:stb_vorbis_info( f:stb_vorbis Ptr )
+	
+Function stb_vorbis_stream_length_in_samples:UInt( f:stb_vorbis Ptr )
+Function stb_vorbis_stream_length_in_seconds:Float( f:stb_vorbis Ptr )
+	
+Function stb_vorbis_get_samples_short_interleaved:Int( f:stb_vorbis Ptr,channels:Int,buffer:Short Ptr,num_shorts:Int )
+Function stb_vorbis_get_samples_short:Int( f:stb_vorbis Ptr,channels:Int,buffer:Short Ptr Ptr,num_samples:Int )
 
 
 Function stb_vorbis_decode_memory:Int( mem:UByte Ptr,len:Int,channels:Int Ptr,sample_rate:Int Ptr,output:Short Ptr Ptr )
 Function stb_vorbis_decode_memory:Int( mem:UByte Ptr,len:Int,channels:Int Ptr,sample_rate:Int Ptr,output:Short Ptr Ptr )