+ ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+
+ if(!glk_data->resource_map) {
+ if(!glk_data->resource_load_callback) {
+ WARNING(_("No resource map has been loaded yet."));
+ return 0;
+ }
+ WARNING(_("Loading sound resources from alternative location not yet supported."));
+ return 0;
+ }
+
+ giblorb_result_t resource;
+ giblorb_err_t result = giblorb_load_resource(glk_data->resource_map, giblorb_method_Memory, &resource, giblorb_ID_Snd, snd);
+ if(result != giblorb_err_None) {
+ WARNING_S( _("Error loading resource"), giblorb_get_error_message(result) );
+ return 0;
+ }
+ g_printerr("playing sound resource %d at %p, length %x\n", snd, resource.data.ptr, resource.length);
+ GInputStream *stream = g_memory_input_stream_new_from_data(resource.data.ptr, resource.length, NULL);
+ g_object_set(chan->source, "stream", stream, NULL);
+