rockbox_ffi 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 25a6b381ae21dc547635e3a29bef5e58cdf2824619cc22e2d590964f64b3a11c
4
- data.tar.gz: 7a3049fcf8233cb3a67bf5d2616c28b6fd2501743ed61d4ab86b89cc61f80db4
3
+ metadata.gz: 7ea9e94f1a583732d3b06ddbb9f6f41e5777a37f2151054820116773d908f8b1
4
+ data.tar.gz: bd92c9ab53fb42598aa6e3d918956e21751d695b4bf7a75be65e9ce7ac8181d5
5
5
  SHA512:
6
- metadata.gz: 35fe9853e8020471633b58882c8fbbcfb47c194ee827157a2269cc113c7526e98db81b56c16122388736cdee8ab28480eff7aa3f5c2eae6fc673211f6bf9c114
7
- data.tar.gz: 1aa5bf1e93395aef9b057a72f7bb0f6a5724771080ac890d0c9749c4e4b53650f74489721a63ce0932c9245fe15f3364f2f463519a2045424b08aff7ee92d73f
6
+ metadata.gz: fe5e0733d3540168cf8b31a5c2f910dd0968fdc2883778a24d3e46e92c48f3edc7fcd5fcbab4eae97b11177fa7cf49f86348c41dbb00b015f0a32f09ebaf5f22
7
+ data.tar.gz: debc3b1bc0f7d340f17ee881d1454e7dd98fe7bf907c8c3e95375ddc863144c2c98509121b4ccc4208a4ca81f1ba4423a3c1412ac353650416a0e7cb00dc6ed4
data/README.md CHANGED
@@ -68,8 +68,8 @@ RockboxFFI::Player.open(volume: 0.8) do |player|
68
68
  player.set_replaygain(RockboxFFI::ReplayGainMode::TRACK, 0.0, true)
69
69
  player.set_crossfade(RockboxFFI::CrossfadeMode::ALWAYS)
70
70
  # Queue entries may be local files, http(s):// URLs to remote media,
71
- # or live-radio / streaming URLs — mix and match freely.
72
- player.set_queue(["a.flac", "https://example.com/b.mp3", "http://radio.example/stream"])
71
+ # or live-radio streams, or HLS / MPEG-DASH manifests (.m3u8/.mpd) — mix and match freely.
72
+ player.set_queue(["a.flac", "https://example.com/b.mp3", "http://radio.example/stream", "https://cdn.example.com/live/main.m3u8"])
73
73
  player.play
74
74
  player.status # => {state: "playing", index: 0, ...}
75
75
  end
data/examples/play.rb CHANGED
@@ -1,8 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Play a local audio file or an http(s):// URL through the real output device.
3
+ # Play an audio source through the real output device.
4
4
  #
5
- # Run: ruby -Ilib examples/play.rb [path-to-audio | http(s)-url]
5
+ # The queue entry can be a local file, a remote http(s):// URL, an
6
+ # internet-radio stream, or an HLS (.m3u8) / MPEG-DASH (.mpd) manifest —
7
+ # the engine detects each kind automatically.
8
+ #
9
+ # Run: ruby -Ilib examples/play.rb [path-or-URL]
10
+ # ruby -Ilib examples/play.rb hls # public HLS test stream
11
+ # ruby -Ilib examples/play.rb dash # public MPEG-DASH test stream
6
12
 
7
13
  $LOAD_PATH.unshift File.expand_path("../lib", __dir__)
8
14
  require "rockbox_ffi"
@@ -10,8 +16,15 @@ require "rockbox_ffi"
10
16
  REPO = File.expand_path("../../..", __dir__)
11
17
  FIXTURE = File.join(REPO, "crates", "rocksky", "fixtures", "08 - Internet Money - Speak(Explicit).m4a")
12
18
 
13
- # The queue accepts local files and http(s):// URLs (remote media / live radio).
14
- file = ARGV[0] || FIXTURE
19
+ # Public adaptive-streaming test streams (see crates/rockbox-playback/README.md
20
+ # for more).
21
+ HLS_DEFAULT = "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8"
22
+ DASH_DEFAULT = "https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd"
23
+
24
+ # The queue accepts local files, http(s):// URLs (remote media / live radio),
25
+ # and HLS / MPEG-DASH manifest URLs.
26
+ arg = ARGV[0] || FIXTURE
27
+ file = { "hls" => HLS_DEFAULT, "dash" => DASH_DEFAULT }.fetch(arg, arg)
15
28
  if !RockboxFFI.is_url?(file) && !File.exist?(file)
16
29
  abort "no such file: #{file}"
17
30
  end
@@ -39,11 +52,15 @@ trap("INT") do
39
52
  end
40
53
 
41
54
  # Poll status until playback finishes (state returns to "stopped").
55
+ # A live stream reports duration 0 and plays until Ctrl-C.
42
56
  loop do
43
57
  st = player.status
44
58
  pos = st[:position_ms] / 1000.0
45
59
  dur = st[:duration_ms] / 1000.0
46
- printf("\r[%s] %.1fs / %.1fs ", st[:state], pos, dur)
60
+ clock = dur.zero? ? format("%.1fs / LIVE", pos) : format("%.1fs / %.1fs", pos, dur)
61
+ # The codec label carries the protocol for adaptive streams (e.g. "HLS AAC").
62
+ codec = st.dig(:metadata, :codec) || ""
63
+ printf("\r[%s] %s %s ", st[:state], codec, clock)
47
64
  $stdout.flush
48
65
 
49
66
  if st[:state] == "stopped" && st[:position_ms].positive?
@@ -1,3 +1,3 @@
1
1
  module RockboxFFI
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rockbox_ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tsiry Sandratraina
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-07-29 00:00:00.000000000 Z
11
+ date: 2026-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fiddle