Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct BufferAndSound<'a> {
- buffer: Rc<SoundBuffer>,
- sound : Sound<'a>,
- }
- impl<'a> BufferAndSound<'a> {
- fn new() -> Self {
- let buffer = Rc::new(SoundBuffer::from_file("some_audio.wav").unwrap());
- let sound = Sound::with_buffer(&buffer);
- BufferAndSound {
- buffer: buffer,
- sound: sound
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement