pub async fn reload_sound_buffers(&self) {
        let buffers = {
            let state = self.state();

            let sound_buffers = state
                .sound_buffers
                .iter()
                .map(|b| b.value.clone())
                .collect::<Vec<SharedSoundBuffer>>();

            for resource in sound_buffers.iter().cloned() {
                let (stream, path, inner_buffer) = {
                    let inner_buffer_ref = resource.data_ref();
                    let inner_buffer = inner_buffer_ref.lock().unwrap();
                    let stream = match *inner_buffer {
                        SoundBuffer::Generic(_) => false,
                        SoundBuffer::Streaming(_) => true,
                    };
                    (
                        stream,
                        inner_buffer.external_data_path().map(|p| p.to_owned()),
                        inner_buffer_ref.clone(),
                    )
                };
                if let Some(ext_path) = path {
                    *resource.state() = ResourceState::new_pending(ext_path.clone());

                    #[cfg(target_arch = "wasm32")]
                    crate::core::wasm_bindgen_futures::spawn_local(async move {
                        reload_sound_buffer(resource, ext_path, stream, inner_buffer).await;
                    });

                    #[cfg(not(target_arch = "wasm32"))]
                    state.thread_pool.spawn_ok(async move {
                        reload_sound_buffer(resource, ext_path, stream, inner_buffer).await;
                    });
                }
            }

            sound_buffers
        };

        crate::core::futures::future::join_all(buffers).await;
    }
/// Reloads every loaded sound buffer. This method is asynchronous, internally it uses thread pool
/// to run reload on separate thread per sound buffer.
Reloads every loaded sound buffer. This method is asynchronous, internally it uses thread pool
to run reload on separate thread per sound buffer.
Reloads every loaded sound buffer . This method is asynchronous internally it uses thread pool to run reload on separate thread per sound buffer .
pub async fn reload_sound_buffers(&self) {
        let buffers = {
            let state = self.state();
            let sound_buffers = state
                .sound_buffers
                .iter()
                .map(|b| b.value.clone())
                .collect::<Vec<SharedSoundBuffer>>();
            for resource in sound_buffers.iter().cloned() {
                let (stream, path, inner_buffer) = {
                    let inner_buffer_ref = resource.data_ref();
                    let inner_buffer = inner_buffer_ref.lock().unwrap();
                    let stream = match *inner_buffer {
                        SoundBuffer::Generic(_) => false,
                        SoundBuffer::Streaming(_) => true,
                    };
                    (
                        stream,
                        inner_buffer.external_data_path().map(|p| p.to_owned()),
                        inner_buffer_ref.clone(),
                    )
                };
                if let Some(ext_path) = path {
                    *resource.state() = ResourceState::new_pending(ext_path.clone());
                    #[cfg(target_arch = "wasm32")]
                    crate::core::wasm_bindgen_futures::spawn_local(async move {
                        reload_sound_buffer(resource, ext_path, stream, inner_buffer).await;
                    });
                    #[cfg(not(target_arch = "wasm32"))]
                    state.thread_pool.spawn_ok(async move {
                        reload_sound_buffer(resource, ext_path, stream, inner_buffer).await;
                    });
                }
            }
            sound_buffers
        };
        crate::core::futures::future::join_all(buffers).await;
    }
pub async fn reload_sound_buffers ( & self ) { let buffers = { let state = self . state ( ) ; let sound_buffers = state . sound_buffers . iter ( ) . map ( | b | b . value . clone ( ) ) . collect :: < Vec < SharedSoundBuffer > > ( ) ; for resource in sound_buffers . iter ( ) . cloned ( ) { let ( stream , path , inner_buffer ) = { let inner_buffer_ref = resource . data_ref ( ) ; let inner_buffer = inner_buffer_ref . lock ( ) . unwrap ( ) ; let stream = match * inner_buffer { SoundBuffer :: Generic ( _ ) => false , SoundBuffer :: Streaming ( _ ) => true , } ; ( stream , inner_buffer . external_data_path ( ) . map ( | p | p . to_owned ( ) ) , inner_buffer_ref . clone ( ) , ) } ; if let Some ( ext_path ) = path { * resource . state ( ) = ResourceState :: new_pending ( ext_path . clone ( ) ) ; # [ cfg ( target_arch " " ) ] crate :: core :: wasm_bindgen_futures :: spawn_local ( async move { reload_sound_buffer ( resource , ext_path , stream , inner_buffer ) . await ; } ) ; # [ cfg ( not ( target_arch " " ) ) ] state . thread_pool . spawn_ok ( async move { reload_sound_buffer ( resource , ext_path , stream , inner_buffer ) . await ; } ) ; } } sound_buffers } ; crate :: core :: futures :: future :: join_all ( buffers ) . await ; }
Reloads every loaded sound buffer.
Reloads every loaded sound buffer .
&self