/* call-seq:
* load_file( filename ) -> Sample
*
* Load an audio sample (a "chunk", to use SDL_mixer's term) from a file.
* Only WAV files are supported at this time.
*
* Raises SDLError if the sample could not be loaded.
*/
VALUE rbgm_sample_new(VALUE class, VALUE filev)
{
VALUE self;
Mix_Chunk* sample;
sample = Mix_LoadWAV( StringValuePtr(filev) );
if( sample == NULL )
{
rb_raise(eSDLError, "Error loading audio Sample from file `%s': %s",
StringValuePtr(filev), Mix_GetError());
}
self = Data_Wrap_Struct( cSample, 0, Mix_FreeChunk, sample );
//rb_obj_call_init(self,argc,argv);
return self;
}