Skip to content

Commit

Permalink
1.4.4
Browse files Browse the repository at this point in the history
- handle multiple identical soundcards
- make CaptureTimeout configure in config.toml (see issue #71)
- use fltk-bundled on Windows
  • Loading branch information
dheijl committed Sep 1, 2022
1 parent 1911ace commit 2b318bd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# swyh-rs Changelog

- 1.4.4-beta2 (Unreleased)
- 1.4.4 (Sep 1 2022 dheijl)
- handle duplicate sound card names by storing the index too (solves issue #70)
- send 250 msec of -60 db white noise when no sound is being captured after 250 msec for LPCM/WAV
- make the CaptureTimeout for LPCM/WAV configurable in the config.toml, with a default of 2000 msec (as it was hardcoded before). If no sound is captured for a CaptureTimeout period, a block of slience of (CaptureTimeout / 4) msec length is sent to the receiver (was previously 250 msec hardcoded).
- for some reason I can no longer compile fltk on Windows with MSVC, so fltk-bundled is used for now on Windows

- 1.4.3 (Aug 3 2022 dheijl)
- update flac-bound to official 0.3.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
authors = ["dheijl <[email protected]>"]
edition = "2021"
name = "swyh-rs"
version = "1.4.4-beta2"
version = "1.4.4"
description = "Stream What You Hear written in Rust"
license = "MIT"
repository = "https://github.com/dheijl/swyh-rs/"
Expand All @@ -22,7 +22,6 @@ dirs = "4.0.0"
flac-bound = { version = "0.3.0", default-features = false, features = [
"libflac-noogg",
] }
fltk = { version = "1.3.13", features = ["fltk-bundled"] }
#fltk-flow = "0.1.4"
htmlescape = "0.3.1"
if-addrs = "0.7.0"
Expand All @@ -44,9 +43,11 @@ ureq = { version = "2.5.0", features = ["charset"] }
url = "2.2.2"
xml-rs = "0.8.4"
[target.'cfg(windows)'.dependencies]
fltk = { version = "1.3.13", features = ["fltk-bundled"] }
winapi = { version = "0.3.9", features = ["winuser", "std"] }
winres = "0.1.12"
[target.'cfg(unix)'.dependencies]
fltk = { version = "1.3.13", features = ["use-ninja"] }
libc = "0.2.132"

[patch.crates-io]
Expand Down
4 changes: 2 additions & 2 deletions src/utils/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl Configuration {
bits_per_sample: Some(16),
streaming_format: Some(StreamingFormat::Lpcm),
monitor_rms: false,
capture_timeout: Some(250),
capture_timeout: Some(2000),
last_renderer: "None".to_string(),
last_network: "None".to_string(),
config_dir: Self::get_config_dir(),
Expand Down Expand Up @@ -134,7 +134,7 @@ impl Configuration {
}
}
if config.configuration.capture_timeout.is_none() {
config.configuration.capture_timeout = Some(250);
config.configuration.capture_timeout = Some(2000);
force_update = true;
}
if force_update {
Expand Down
5 changes: 3 additions & 2 deletions src/utils/rwstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ChannelStream {
r: rx,
fifo: VecDeque::with_capacity(16384),
flac_fifo: VecDeque::with_capacity(16384),
silence: get_noise_buffer(sample_rate, capture_timout),
silence: get_silence_buffer(sample_rate, capture_timout / 4),
capture_timeout: Duration::from_millis(capture_timout), // silence kicks in after CAPTURE_TIMEOUT seconds
sending_silence: false,
remote_ip: remote_ip_addr,
Expand Down Expand Up @@ -208,7 +208,7 @@ fn create_wav_hdr(sample_rate: u32, bits_per_sample: u16) -> Vec<u8> {
hdr.to_vec()
}

#[allow(dead_code)]
//#[allow(dead_code)]
fn get_silence_buffer(sample_rate: u32, silence_period: u64) -> Vec<f32> {
let divisor: u64 = 1000 / silence_period;
let size = ((sample_rate * 2) / divisor as u32) as usize;
Expand All @@ -220,6 +220,7 @@ fn get_silence_buffer(sample_rate: u32, silence_period: u64) -> Vec<f32> {
///
/// fille the pre-allocated noise buffer with a very faint white noise (-60db)
///
#[allow(dead_code)]
fn get_noise_buffer(sample_rate: u32, silence_period: u64) -> Vec<f32> {
// create the random generator for the white noise
let mut rng = StdRng::seed_from_u64(79);
Expand Down
2 changes: 1 addition & 1 deletion swyh-rs.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[Setup]
AppName=swyh-rs
AppVersion=1.4.4-beta2
AppVersion=1.4.4
WizardStyle=modern
DefaultDirName={autopf}\swyh-rs
DefaultGroupName=swyh-rs
Expand Down

0 comments on commit 2b318bd

Please sign in to comment.