+#ifdef GSTREAMER_SOUND
+ ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key);
+ giblorb_result_t resource;
+ giblorb_err_t result;
+
+ /* Sound load hints only work for Blorb resource maps */
+ if(!glk_data->resource_map)
+ return;
+
+ if(flag) {
+ /* The sound load hint simply loads the resource from the resource map;
+ loading a chunk more than once does nothing */
+ 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;
+ }
+ } else {
+ /* Get the Blorb chunk number by loading the resource with
+ method_DontLoad, then unload that chunk - has no effect if the chunk
+ isn't loaded */
+ result = giblorb_load_resource(glk_data->resource_map, giblorb_method_DontLoad, &resource, giblorb_ID_Snd, snd);
+ if(result != giblorb_err_None) {
+ WARNING_S( _("Error loading resource"), giblorb_get_error_message(result) );
+ return;
+ }
+ result = giblorb_unload_chunk(glk_data->resource_map, resource.chunknum);
+ if(result != giblorb_err_None) {
+ WARNING_S( _("Error unloading chunk"), giblorb_get_error_message(result) );
+ return;
+ }
+ }
+#endif /* GSTREAMER_SOUND */