Comments (2)
Hey, good news, figured out how to use this in 2021! Sound working on desktop Linux!!
Now it's not ideal since @kondrak doesn't seem to work on this anymore and it relies on a deprecated version of Rust-SDL2. But if you patch your Rust-SDL2 v0.25.0 (https://github.com/Rust-SDL2/rust-sdl2/tree/0.26.0 , for some reason no 0.25.0 tag on GitHub) like this:
diff --git a/audio.rs b/home/fred/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-0.25.0/src/sdl2/audio.rs
index c5982da..0eaeb00 100644
--- a/audio.rs
+++ b/home/fred/.cargo/registry/src/github.com-1ecc6299db9ec823/sdl2-0.25.0/src/sdl2/audio.rs
@@ -558,6 +558,7 @@ pub struct AudioDevice<CB: AudioCallback> {
userdata: Box<CB>
}
+use std::mem::MaybeUninit;
impl<CB: AudioCallback> AudioDevice<CB> {
/// Opens a new audio device given the desired parameters and callback.
pub fn open_playback<F>(a: &AudioSubsystem, device: Option<&str>, spec: &AudioSpecDesired, get_callback: F) -> Result<AudioDevice <CB>, String>
@@ -568,7 +569,7 @@ impl<CB: AudioCallback> AudioDevice<CB> {
// callback without the obtained AudioSpec.
// Create an uninitialized box that will be initialized after SDL_OpenAudioDevice.
let userdata: *mut CB = unsafe {
- let b: Box<CB> = Box::new(mem::uninitialized());
+ let b: Box<MaybeUninit<CB>> = Box::new(MaybeUninit::uninit());
mem::transmute(b)
};
let desired = AudioSpecDesired::convert_to_ll(spec.freq, spec.channels, spec.samples, userdata);
Then prgs/playsound.prg
works fine~ :-D
Check it out, running fine even compiled with Rust v1.58, debugger & all!
from rust64.
I totally forgot about your report :) Thanks for looking into the problem, bumping SDL2 to 0.35.0 was enough to fix the issue (it's now pushed to master).
from rust64.
Related Issues (17)
- Linking fails on x86 HOT 15
- Problem with sprites
- Backspace?? HOT 9
- Adjust speed? HOT 1
- Panic on running "Daah, Those Acid Pills!" HOT 4
- I'd like to help emulate iec and drives HOT 6
- Use resid-rs HOT 2
- Possible copypast issue
- Found a copied repo HOT 1
- Opcode request HOT 1
- 100% CPU usage and speed issues HOT 24
- Rewrite CPU op execution scheme HOT 1
- Responsiveness issues in certain programs HOT 1
- Investigate cpal for audio output
- Consider SID player as a separate cargo project
- minifb no longer compatible HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust64.