TonieToolbox 0.5.1__tar.gz → 0.6.0__tar.gz
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.
- {tonietoolbox-0.5.1/TonieToolbox.egg-info → tonietoolbox-0.6.0}/PKG-INFO +129 -92
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/README.md +126 -90
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/__init__.py +2 -1
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/__main__.py +240 -98
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/artwork.py +59 -10
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/audio_conversion.py +33 -29
- tonietoolbox-0.6.0/TonieToolbox/constants.py +213 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/dependency_manager.py +679 -184
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/filename_generator.py +57 -10
- tonietoolbox-0.6.0/TonieToolbox/integration.py +73 -0
- tonietoolbox-0.6.0/TonieToolbox/integration_macos.py +613 -0
- tonietoolbox-0.6.0/TonieToolbox/integration_ubuntu.py +2 -0
- tonietoolbox-0.6.0/TonieToolbox/integration_windows.py +445 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/logger.py +9 -10
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/media_tags.py +19 -100
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/ogg_page.py +41 -41
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/opus_packet.py +15 -15
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/recursive_processor.py +24 -23
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tags.py +4 -5
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/teddycloud.py +164 -51
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tonie_analysis.py +26 -24
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tonie_file.py +73 -45
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tonies_json.py +71 -67
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/version_handler.py +14 -20
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0/TonieToolbox.egg-info}/PKG-INFO +129 -92
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox.egg-info/SOURCES.txt +4 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox.egg-info/requires.txt +1 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/pyproject.toml +3 -2
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/setup.py +5 -2
- tonietoolbox-0.5.1/TonieToolbox/constants.py +0 -90
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/LICENSE.md +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/MANIFEST.in +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tonie_header.proto +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox/tonie_header_pb2.py +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox.egg-info/dependency_links.txt +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox.egg-info/entry_points.txt +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/TonieToolbox.egg-info/top_level.txt +0 -0
- {tonietoolbox-0.5.1 → tonietoolbox-0.6.0}/setup.cfg +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: TonieToolbox
|
3
|
-
Version: 0.
|
4
|
-
Summary:
|
3
|
+
Version: 0.6.0
|
4
|
+
Summary: Convert audio files to Toniebox compatible format (.TAF) and interact with TeddyCloud.
|
5
5
|
Home-page: https://github.com/Quentendo64/TonieToolbox
|
6
6
|
Author: Quentendo64
|
7
7
|
Author-email: Quentendo64 <quentin@wohlfeil.at>
|
@@ -23,6 +23,7 @@ Requires-Dist: protobuf<=3.19.0
|
|
23
23
|
Requires-Dist: requests>=2.32.3
|
24
24
|
Requires-Dist: mutagen>=1.47.0
|
25
25
|
Requires-Dist: packaging>=25.0
|
26
|
+
Requires-Dist: tqdm>=4.67.1
|
26
27
|
Provides-Extra: test
|
27
28
|
Requires-Dist: pytest>=8.3.5; extra == "test"
|
28
29
|
Requires-Dist: pytest-cov>=6.1.1; extra == "test"
|
@@ -33,7 +34,7 @@ Dynamic: requires-python
|
|
33
34
|
|
34
35
|
# TonieToolbox 🎵📦
|
35
36
|
|
36
|
-
[](https://github.com/Quentendo64/TonieToolbox/actions)
|
37
38
|
[](https://github.com/Quentendo64/TonieToolbox/actions)
|
38
39
|
|
39
40
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
@@ -48,6 +49,14 @@ A Toolkit for converting various audio formats into the Tonie-compatible TAF for
|
|
48
49
|
→ [HOWTO Guide for Beginners](HOWTO.md)
|
49
50
|
→ [Contributing Guidelines](CONTRIBUTING.md)
|
50
51
|
|
52
|
+
## 🎯 New Features (v0.6.0)
|
53
|
+
|
54
|
+
The latest release of TonieToolbox includes exciting new capabilities:
|
55
|
+
|
56
|
+
- **Enhanced Media Tag Support**: Better handling of complex audio libraries with advanced metadata extraction and usage of tags in your upload path (--path) or as output directory with the new argument --output-to-template eg. "C:\Music\\{albumartist}\\{album}"
|
57
|
+
- **Windows Context Menu Integration**: Right-click to convert audio files directly from File Explorer. Use --config-integration to configure the upload functions. If not needed just use --install-integration
|
58
|
+
|
59
|
+
|
51
60
|
## Table of Contents
|
52
61
|
|
53
62
|
- [Overview](#overview)
|
@@ -225,7 +234,7 @@ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonieto
|
|
225
234
|
docker run --rm -v "%cd%\input:/tonietoolbox/input" -v "%cd%\output:/tonietoolbox/output" quentendo64/tonietoolbox input/my-audio-file.mp3
|
226
235
|
```
|
227
236
|
|
228
|
-
**Or using docker-compose
|
237
|
+
**Or using docker-compose:**
|
229
238
|
|
230
239
|
```shell
|
231
240
|
docker-compose run --rm tonietoolbox input/my-audio-file.mp3
|
@@ -262,12 +271,17 @@ Output:
|
|
262
271
|
```shell
|
263
272
|
usage: TonieToolbox.py [-h] [-v] [--upload URL] [--include-artwork] [--get-tags URL]
|
264
273
|
[--ignore-ssl-verify] [--special-folder FOLDER] [--path PATH]
|
265
|
-
[--
|
266
|
-
[--
|
267
|
-
[--
|
274
|
+
[--connection-timeout SECONDS] [--read-timeout SECONDS]
|
275
|
+
[--max-retries RETRIES] [--retry-delay SECONDS]
|
276
|
+
[--create-custom-json] [--version-2] [--username USERNAME]
|
277
|
+
[--password PASSWORD] [--client-cert CERT_FILE]
|
278
|
+
[--client-key KEY_FILE] [-t TIMESTAMP] [-f FFMPEG]
|
268
279
|
[-o OPUSENC] [-b BITRATE] [-c] [-a TAG] [-n] [-i] [-s] [-r] [-O]
|
269
|
-
[-
|
270
|
-
[--
|
280
|
+
[-fc] [--no-mono-conversion] [-A] [-k] [-u] [-C FILE2] [-D]
|
281
|
+
[--config-integration] [--install-integration]
|
282
|
+
[--uninstall-integration] [-m] [--name-template TEMPLATE]
|
283
|
+
[--output-to-template PATH_TEMPLATE] [--show-tags]
|
284
|
+
[-S] [-F] [-X] [-d] [-T] [-q] [-Q] [--log-file]
|
271
285
|
SOURCE [TARGET]
|
272
286
|
|
273
287
|
Create Tonie compatible file from Ogg opus file(s).
|
@@ -283,8 +297,7 @@ TeddyCloud Options:
|
|
283
297
|
--ignore-ssl-verify Ignore SSL certificate verification (for self-signed certificates)
|
284
298
|
--special-folder FOLDER
|
285
299
|
Special folder to upload to (currently only "library" is supported)
|
286
|
-
--path PATH Path where to write the file on TeddyCloud server
|
287
|
-
--show-progress Show progress bar during file upload (default: enabled)
|
300
|
+
--path PATH Path where to write the file on TeddyCloud server (supports templates like "/{albumartist}/{album}")
|
288
301
|
--connection-timeout SECONDS
|
289
302
|
Connection timeout in seconds (default: 10)
|
290
303
|
--read-timeout SECONDS
|
@@ -294,12 +307,19 @@ TeddyCloud Options:
|
|
294
307
|
--retry-delay SECONDS
|
295
308
|
Delay between retry attempts in seconds (default: 5)
|
296
309
|
--create-custom-json Fetch and update custom Tonies JSON data
|
310
|
+
--version-2 Use version 2 of the Tonies JSON format (default: version 1)
|
311
|
+
--username USERNAME Username for basic authentication
|
312
|
+
--password PASSWORD Password for basic authentication
|
313
|
+
--client-cert CERT_FILE
|
314
|
+
Path to client certificate file for certificate-based authentication
|
315
|
+
--client-key KEY_FILE
|
316
|
+
Path to client private key file for certificate-based authentication
|
297
317
|
|
298
318
|
optional arguments:
|
299
319
|
-h, --help show this help message and exit
|
300
320
|
-v, --version show program version and exit
|
301
321
|
-t, --timestamp TIMESTAMP
|
302
|
-
set custom timestamp / bitstream serial
|
322
|
+
set custom timestamp / bitstream serial
|
303
323
|
-f, --ffmpeg FFMPEG specify location of ffmpeg
|
304
324
|
-o, --opusenc OPUSENC specify location of opusenc
|
305
325
|
-b, --bitrate BITRATE set encoding bitrate in kbps (default: 96)
|
@@ -312,17 +332,27 @@ optional arguments:
|
|
312
332
|
-r, --recursive Process folders recursively
|
313
333
|
-O, --output-to-source
|
314
334
|
Save output files in the source directory instead of output directory
|
335
|
+
-fc, --force-creation
|
336
|
+
Force creation of Tonie file even if it already exists
|
337
|
+
--no-mono-conversion Do not convert mono audio to stereo (default: convert mono to stereo)
|
315
338
|
-A, --auto-download Automatically download FFmpeg and opusenc if needed
|
316
339
|
-k, --keep-temp Keep temporary opus files in a temp folder for testing
|
317
|
-
-u, --use-legacy-tags Use legacy hardcoded tags instead of dynamic TonieToolbox tags
|
340
|
+
-u, --use-legacy-tags Use legacy hardcoded tags instead of dynamic TonieToolbox tags
|
318
341
|
-C, --compare FILE2 Compare input file with another .taf file for debugging
|
319
342
|
-D, --detailed-compare
|
320
343
|
Show detailed OGG page differences when comparing files
|
321
|
-
--
|
344
|
+
--config-integration Configure context menu integration
|
345
|
+
--install-integration
|
346
|
+
Integrate with the system (e.g., create context menu entries)
|
347
|
+
--uninstall-integration
|
348
|
+
Uninstall context menu integration
|
349
|
+
|
322
350
|
Media Tag Options:
|
323
351
|
-m, --use-media-tags Use media tags from audio files for naming
|
324
352
|
--name-template TEMPLATE
|
325
353
|
Template for naming files using media tags. Example: "{album} - {artist}"
|
354
|
+
--output-to-template PATH_TEMPLATE
|
355
|
+
Template for output path using media tags. Example: "C:\Music\{albumartist}\{album}"
|
326
356
|
--show-tags Show available media tags from input files
|
327
357
|
|
328
358
|
Version Check Options:
|
@@ -543,6 +573,87 @@ tonietoolbox --split my_tonie.taf --debug
|
|
543
573
|
tonietoolbox --recursive "Music/Collection/" --quiet
|
544
574
|
```
|
545
575
|
|
576
|
+
#### Force creation of TAF files
|
577
|
+
|
578
|
+
If a valid TAF file already exists, TonieToolbox will skip recreating it by default. To force creation even if the file exists:
|
579
|
+
|
580
|
+
```shell
|
581
|
+
# Force creation of a TAF file even if it already exists
|
582
|
+
tonietoolbox input.mp3 --force-creation
|
583
|
+
```
|
584
|
+
|
585
|
+
This is useful when you want to update the content or encoding settings of an existing TAF file.
|
586
|
+
|
587
|
+
#### Windows Context Menu Integration
|
588
|
+
|
589
|
+
TonieToolbox can integrate with Windows Explorer, allowing you to right-click on audio files or folders to convert them:
|
590
|
+
|
591
|
+
```shell
|
592
|
+
# Install context menu integration (one-time setup)
|
593
|
+
tonietoolbox --install-integration
|
594
|
+
|
595
|
+
# Configure context menu options
|
596
|
+
tonietoolbox --config-integration
|
597
|
+
|
598
|
+
# Remove context menu integration
|
599
|
+
tonietoolbox --uninstall-integration
|
600
|
+
```
|
601
|
+
|
602
|
+
After installation, you can right-click on any audio file or folder in Windows Explorer and select "Convert to Tonie Format".
|
603
|
+
|
604
|
+
When changing the configuration via `--config-integration`. Apply them to the integration by simply execute `tonietoolbox --install-integration` again.
|
605
|
+
|
606
|
+
#### Log File Generation
|
607
|
+
|
608
|
+
Save detailed logs to a timestamped file for troubleshooting complex operations:
|
609
|
+
|
610
|
+
```shell
|
611
|
+
# Enable log file generation
|
612
|
+
tonietoolbox input.mp3 --log-file
|
613
|
+
|
614
|
+
# Combine with debug logging for maximum detail
|
615
|
+
tonietoolbox --recursive input_directory/ --log-file --debug
|
616
|
+
```
|
617
|
+
|
618
|
+
Log files are saved in the `.tonietoolbox\logs` folder in your user directory.
|
619
|
+
|
620
|
+
#### Enhanced Media Tag Templates
|
621
|
+
|
622
|
+
Create custom directory structures based on media tags:
|
623
|
+
|
624
|
+
```shell
|
625
|
+
# Create output based on a path template
|
626
|
+
tonietoolbox input.mp3 --use-media-tags --output-to-template "C:\Music\{albumartist}\{album}"
|
627
|
+
|
628
|
+
# Use with recursive processing
|
629
|
+
tonietoolbox --recursive "Music/Collection/" --use-media-tags --output-to-template "Organized/{genre}/{year} - {album}"
|
630
|
+
```
|
631
|
+
|
632
|
+
This creates a directory structure based on the audio files' metadata and places the converted TAF files accordingly.
|
633
|
+
|
634
|
+
#### TeddyCloud Authentication Options
|
635
|
+
|
636
|
+
> **Note:** Authentication is based on the Features available when using [TeddyCloudStarter](https://github.com/Quentendo64/TeddyCloudStarter).
|
637
|
+
|
638
|
+
TonieToolbox supports multiple authentication methods for secure TeddyCloud connections:
|
639
|
+
|
640
|
+
```shell
|
641
|
+
# Basic authentication with username and password
|
642
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --username admin --password secret
|
643
|
+
|
644
|
+
# Certificate-based authentication
|
645
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --client-cert certificate.crt --client-key private.key
|
646
|
+
```
|
647
|
+
|
648
|
+
#### Custom JSON Format Versioning
|
649
|
+
|
650
|
+
Choose between different versions of the Tonies JSON format:
|
651
|
+
|
652
|
+
```shell
|
653
|
+
# Use version 2 of the Tonies JSON format (enhanced metadata)
|
654
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --create-custom-json --version-2
|
655
|
+
```
|
656
|
+
|
546
657
|
### Media Tags
|
547
658
|
|
548
659
|
TonieToolbox can read metadata tags from audio files (such as ID3 tags in MP3 files, Vorbis comments in FLAC/OGG files, etc.) and use them to create more meaningful filenames or display information about your audio collection.
|
@@ -699,81 +810,7 @@ tonietoolbox "C:\Music\Classical\Bach" --use-media-tags --name-template "{compos
|
|
699
810
|
The first command shows what tags are available, allowing you to create precise naming templates for classical music collections.
|
700
811
|
|
701
812
|
## Technical Details
|
702
|
-
|
703
|
-
### TAF (Tonie Audio Format) File Structure
|
704
|
-
|
705
|
-
The Tonie Audio Format (TAF) consists of several parts:
|
706
|
-
|
707
|
-
#### 1. Tonie Header (0x1000 bytes)
|
708
|
-
|
709
|
-
Located at the beginning of the file, structured as:
|
710
|
-
|
711
|
-
- A 4-byte big-endian integer specifying the header length
|
712
|
-
- A Protocol Buffer encoded header (defined in `tonie_header.proto`)
|
713
|
-
- Padding to fill the entire 4096 bytes (0x1000)
|
714
|
-
|
715
|
-
The Protocol Buffer structure contains:
|
716
|
-
|
717
|
-
```protobuf
|
718
|
-
message TonieHeader {
|
719
|
-
bytes dataHash = 1; // SHA1 hash of the audio data
|
720
|
-
uint32 dataLength = 2; // Length of the audio data in bytes
|
721
|
-
uint32 timestamp = 3; // Unix timestamp (also used as bitstream serial number)
|
722
|
-
repeated uint32 chapterPages = 4 [packed=true]; // Page numbers for chapter starts
|
723
|
-
bytes padding = 5; // Padding to fill up the header
|
724
|
-
}
|
725
|
-
```
|
726
|
-
|
727
|
-
#### 2. Audio Data
|
728
|
-
|
729
|
-
The audio data consists of:
|
730
|
-
|
731
|
-
- Opus encoded audio in Ogg container format
|
732
|
-
- Every page after the header has a fixed size of 4096 bytes (0x1000)
|
733
|
-
- First page contains the Opus identification header
|
734
|
-
- Second page contains the Opus comments/tags
|
735
|
-
- Remaining pages contain the actual audio data
|
736
|
-
- All pages use the same bitstream serial number (timestamp from header)
|
737
|
-
|
738
|
-
#### 3. Special Requirements
|
739
|
-
|
740
|
-
For optimal compatibility with Tonie boxes:
|
741
|
-
|
742
|
-
- Audio should be stereo (2 channels)
|
743
|
-
- Sample rate must be 48 kHz
|
744
|
-
- Pages must be aligned to 4096 byte boundaries
|
745
|
-
- Bitrate of 96 kbps VBR is recommended
|
746
|
-
|
747
|
-
**Mono audio handling:**
|
748
|
-
|
749
|
-
- By default, TonieToolbox will automatically convert mono audio files to stereo for compatibility.
|
750
|
-
- To disable this behavior (and require your input to already be stereo), use the `--no-mono-conversion` flag.
|
751
|
-
|
752
|
-
### File Analysis
|
753
|
-
|
754
|
-
When using the `--info` flag, TonieToolbox checks and displays detailed information about a .TAF (Tonie Audio File):
|
755
|
-
|
756
|
-
- SHA1 hash validation
|
757
|
-
- Timestamp/bitstream serial consistency
|
758
|
-
- Opus data length verification
|
759
|
-
- Opus header validation (version, channels, sample rate)
|
760
|
-
- Page alignment and size validation
|
761
|
-
- Total runtime
|
762
|
-
- Track listing with durations
|
763
|
-
|
764
|
-
### File Comparison
|
765
|
-
|
766
|
-
When using the `--compare` flag, TonieToolbox provides a detailed comparison of two .TAF files:
|
767
|
-
|
768
|
-
- File size comparison
|
769
|
-
- Header size verification
|
770
|
-
- Timestamp comparison
|
771
|
-
- Data length validation
|
772
|
-
- SHA1 hash verification
|
773
|
-
- Chapter page structure analysis
|
774
|
-
- OGG page-by-page comparison (with `--detailed-compare` flag)
|
775
|
-
|
776
|
-
This is particularly useful for debugging when creating TAF files with different tools or parameters.
|
813
|
+
[Moved to TECHNICAL.md](TECHNICAL.md)
|
777
814
|
|
778
815
|
## Related Projects
|
779
816
|
|
@@ -783,9 +820,6 @@ This project is inspired by and builds upon the work of other Tonie-related open
|
|
783
820
|
- [teddycloud](https://github.com/toniebox-reverse-engineering/teddycloud) - Self-hosted alternative to the Tonie cloud / Boxine cloud for managing custom content
|
784
821
|
- [TeddyCloudStarter](https://github.com/Quentendo64/TeddyCloudStarter) - A Wizard for Docker-based deployment of [teddycloud](https://github.com/toniebox-reverse-engineering/teddycloud)
|
785
822
|
|
786
|
-
## Contributing
|
787
|
-
|
788
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
789
823
|
|
790
824
|
## Legal Notice
|
791
825
|
|
@@ -806,3 +840,6 @@ If you need help, have questions, or want to report a bug, please use the follow
|
|
806
840
|
- [GitHub Issues](https://github.com/Quentendo64/TonieToolbox/issues) for bug reports and feature requests
|
807
841
|
- [GitHub Discussions](https://github.com/Quentendo64/TonieToolbox/discussions) for general questions and community support
|
808
842
|
- [HOWTO Guide](HOWTO.md) for common usage instructions
|
843
|
+
|
844
|
+
## Attribution
|
845
|
+
[Parrot Icon created by Freepik - Flaticon](https://www.flaticon.com/free-animated-icons/parrot)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
# TonieToolbox 🎵📦
|
2
2
|
|
3
|
-
[](https://github.com/Quentendo64/TonieToolbox/actions)
|
4
4
|
[](https://github.com/Quentendo64/TonieToolbox/actions)
|
5
5
|
|
6
6
|
[](https://www.gnu.org/licenses/gpl-3.0)
|
@@ -15,6 +15,14 @@ A Toolkit for converting various audio formats into the Tonie-compatible TAF for
|
|
15
15
|
→ [HOWTO Guide for Beginners](HOWTO.md)
|
16
16
|
→ [Contributing Guidelines](CONTRIBUTING.md)
|
17
17
|
|
18
|
+
## 🎯 New Features (v0.6.0)
|
19
|
+
|
20
|
+
The latest release of TonieToolbox includes exciting new capabilities:
|
21
|
+
|
22
|
+
- **Enhanced Media Tag Support**: Better handling of complex audio libraries with advanced metadata extraction and usage of tags in your upload path (--path) or as output directory with the new argument --output-to-template eg. "C:\Music\\{albumartist}\\{album}"
|
23
|
+
- **Windows Context Menu Integration**: Right-click to convert audio files directly from File Explorer. Use --config-integration to configure the upload functions. If not needed just use --install-integration
|
24
|
+
|
25
|
+
|
18
26
|
## Table of Contents
|
19
27
|
|
20
28
|
- [Overview](#overview)
|
@@ -192,7 +200,7 @@ docker run --rm -v "$(pwd)/input:/tonietoolbox/input" -v "$(pwd)/output:/tonieto
|
|
192
200
|
docker run --rm -v "%cd%\input:/tonietoolbox/input" -v "%cd%\output:/tonietoolbox/output" quentendo64/tonietoolbox input/my-audio-file.mp3
|
193
201
|
```
|
194
202
|
|
195
|
-
**Or using docker-compose
|
203
|
+
**Or using docker-compose:**
|
196
204
|
|
197
205
|
```shell
|
198
206
|
docker-compose run --rm tonietoolbox input/my-audio-file.mp3
|
@@ -229,12 +237,17 @@ Output:
|
|
229
237
|
```shell
|
230
238
|
usage: TonieToolbox.py [-h] [-v] [--upload URL] [--include-artwork] [--get-tags URL]
|
231
239
|
[--ignore-ssl-verify] [--special-folder FOLDER] [--path PATH]
|
232
|
-
[--
|
233
|
-
[--
|
234
|
-
[--
|
240
|
+
[--connection-timeout SECONDS] [--read-timeout SECONDS]
|
241
|
+
[--max-retries RETRIES] [--retry-delay SECONDS]
|
242
|
+
[--create-custom-json] [--version-2] [--username USERNAME]
|
243
|
+
[--password PASSWORD] [--client-cert CERT_FILE]
|
244
|
+
[--client-key KEY_FILE] [-t TIMESTAMP] [-f FFMPEG]
|
235
245
|
[-o OPUSENC] [-b BITRATE] [-c] [-a TAG] [-n] [-i] [-s] [-r] [-O]
|
236
|
-
[-
|
237
|
-
[--
|
246
|
+
[-fc] [--no-mono-conversion] [-A] [-k] [-u] [-C FILE2] [-D]
|
247
|
+
[--config-integration] [--install-integration]
|
248
|
+
[--uninstall-integration] [-m] [--name-template TEMPLATE]
|
249
|
+
[--output-to-template PATH_TEMPLATE] [--show-tags]
|
250
|
+
[-S] [-F] [-X] [-d] [-T] [-q] [-Q] [--log-file]
|
238
251
|
SOURCE [TARGET]
|
239
252
|
|
240
253
|
Create Tonie compatible file from Ogg opus file(s).
|
@@ -250,8 +263,7 @@ TeddyCloud Options:
|
|
250
263
|
--ignore-ssl-verify Ignore SSL certificate verification (for self-signed certificates)
|
251
264
|
--special-folder FOLDER
|
252
265
|
Special folder to upload to (currently only "library" is supported)
|
253
|
-
--path PATH Path where to write the file on TeddyCloud server
|
254
|
-
--show-progress Show progress bar during file upload (default: enabled)
|
266
|
+
--path PATH Path where to write the file on TeddyCloud server (supports templates like "/{albumartist}/{album}")
|
255
267
|
--connection-timeout SECONDS
|
256
268
|
Connection timeout in seconds (default: 10)
|
257
269
|
--read-timeout SECONDS
|
@@ -261,12 +273,19 @@ TeddyCloud Options:
|
|
261
273
|
--retry-delay SECONDS
|
262
274
|
Delay between retry attempts in seconds (default: 5)
|
263
275
|
--create-custom-json Fetch and update custom Tonies JSON data
|
276
|
+
--version-2 Use version 2 of the Tonies JSON format (default: version 1)
|
277
|
+
--username USERNAME Username for basic authentication
|
278
|
+
--password PASSWORD Password for basic authentication
|
279
|
+
--client-cert CERT_FILE
|
280
|
+
Path to client certificate file for certificate-based authentication
|
281
|
+
--client-key KEY_FILE
|
282
|
+
Path to client private key file for certificate-based authentication
|
264
283
|
|
265
284
|
optional arguments:
|
266
285
|
-h, --help show this help message and exit
|
267
286
|
-v, --version show program version and exit
|
268
287
|
-t, --timestamp TIMESTAMP
|
269
|
-
set custom timestamp / bitstream serial
|
288
|
+
set custom timestamp / bitstream serial
|
270
289
|
-f, --ffmpeg FFMPEG specify location of ffmpeg
|
271
290
|
-o, --opusenc OPUSENC specify location of opusenc
|
272
291
|
-b, --bitrate BITRATE set encoding bitrate in kbps (default: 96)
|
@@ -279,17 +298,27 @@ optional arguments:
|
|
279
298
|
-r, --recursive Process folders recursively
|
280
299
|
-O, --output-to-source
|
281
300
|
Save output files in the source directory instead of output directory
|
301
|
+
-fc, --force-creation
|
302
|
+
Force creation of Tonie file even if it already exists
|
303
|
+
--no-mono-conversion Do not convert mono audio to stereo (default: convert mono to stereo)
|
282
304
|
-A, --auto-download Automatically download FFmpeg and opusenc if needed
|
283
305
|
-k, --keep-temp Keep temporary opus files in a temp folder for testing
|
284
|
-
-u, --use-legacy-tags Use legacy hardcoded tags instead of dynamic TonieToolbox tags
|
306
|
+
-u, --use-legacy-tags Use legacy hardcoded tags instead of dynamic TonieToolbox tags
|
285
307
|
-C, --compare FILE2 Compare input file with another .taf file for debugging
|
286
308
|
-D, --detailed-compare
|
287
309
|
Show detailed OGG page differences when comparing files
|
288
|
-
--
|
310
|
+
--config-integration Configure context menu integration
|
311
|
+
--install-integration
|
312
|
+
Integrate with the system (e.g., create context menu entries)
|
313
|
+
--uninstall-integration
|
314
|
+
Uninstall context menu integration
|
315
|
+
|
289
316
|
Media Tag Options:
|
290
317
|
-m, --use-media-tags Use media tags from audio files for naming
|
291
318
|
--name-template TEMPLATE
|
292
319
|
Template for naming files using media tags. Example: "{album} - {artist}"
|
320
|
+
--output-to-template PATH_TEMPLATE
|
321
|
+
Template for output path using media tags. Example: "C:\Music\{albumartist}\{album}"
|
293
322
|
--show-tags Show available media tags from input files
|
294
323
|
|
295
324
|
Version Check Options:
|
@@ -510,6 +539,87 @@ tonietoolbox --split my_tonie.taf --debug
|
|
510
539
|
tonietoolbox --recursive "Music/Collection/" --quiet
|
511
540
|
```
|
512
541
|
|
542
|
+
#### Force creation of TAF files
|
543
|
+
|
544
|
+
If a valid TAF file already exists, TonieToolbox will skip recreating it by default. To force creation even if the file exists:
|
545
|
+
|
546
|
+
```shell
|
547
|
+
# Force creation of a TAF file even if it already exists
|
548
|
+
tonietoolbox input.mp3 --force-creation
|
549
|
+
```
|
550
|
+
|
551
|
+
This is useful when you want to update the content or encoding settings of an existing TAF file.
|
552
|
+
|
553
|
+
#### Windows Context Menu Integration
|
554
|
+
|
555
|
+
TonieToolbox can integrate with Windows Explorer, allowing you to right-click on audio files or folders to convert them:
|
556
|
+
|
557
|
+
```shell
|
558
|
+
# Install context menu integration (one-time setup)
|
559
|
+
tonietoolbox --install-integration
|
560
|
+
|
561
|
+
# Configure context menu options
|
562
|
+
tonietoolbox --config-integration
|
563
|
+
|
564
|
+
# Remove context menu integration
|
565
|
+
tonietoolbox --uninstall-integration
|
566
|
+
```
|
567
|
+
|
568
|
+
After installation, you can right-click on any audio file or folder in Windows Explorer and select "Convert to Tonie Format".
|
569
|
+
|
570
|
+
When changing the configuration via `--config-integration`. Apply them to the integration by simply execute `tonietoolbox --install-integration` again.
|
571
|
+
|
572
|
+
#### Log File Generation
|
573
|
+
|
574
|
+
Save detailed logs to a timestamped file for troubleshooting complex operations:
|
575
|
+
|
576
|
+
```shell
|
577
|
+
# Enable log file generation
|
578
|
+
tonietoolbox input.mp3 --log-file
|
579
|
+
|
580
|
+
# Combine with debug logging for maximum detail
|
581
|
+
tonietoolbox --recursive input_directory/ --log-file --debug
|
582
|
+
```
|
583
|
+
|
584
|
+
Log files are saved in the `.tonietoolbox\logs` folder in your user directory.
|
585
|
+
|
586
|
+
#### Enhanced Media Tag Templates
|
587
|
+
|
588
|
+
Create custom directory structures based on media tags:
|
589
|
+
|
590
|
+
```shell
|
591
|
+
# Create output based on a path template
|
592
|
+
tonietoolbox input.mp3 --use-media-tags --output-to-template "C:\Music\{albumartist}\{album}"
|
593
|
+
|
594
|
+
# Use with recursive processing
|
595
|
+
tonietoolbox --recursive "Music/Collection/" --use-media-tags --output-to-template "Organized/{genre}/{year} - {album}"
|
596
|
+
```
|
597
|
+
|
598
|
+
This creates a directory structure based on the audio files' metadata and places the converted TAF files accordingly.
|
599
|
+
|
600
|
+
#### TeddyCloud Authentication Options
|
601
|
+
|
602
|
+
> **Note:** Authentication is based on the Features available when using [TeddyCloudStarter](https://github.com/Quentendo64/TeddyCloudStarter).
|
603
|
+
|
604
|
+
TonieToolbox supports multiple authentication methods for secure TeddyCloud connections:
|
605
|
+
|
606
|
+
```shell
|
607
|
+
# Basic authentication with username and password
|
608
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --username admin --password secret
|
609
|
+
|
610
|
+
# Certificate-based authentication
|
611
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --client-cert certificate.crt --client-key private.key
|
612
|
+
```
|
613
|
+
|
614
|
+
#### Custom JSON Format Versioning
|
615
|
+
|
616
|
+
Choose between different versions of the Tonies JSON format:
|
617
|
+
|
618
|
+
```shell
|
619
|
+
# Use version 2 of the Tonies JSON format (enhanced metadata)
|
620
|
+
tonietoolbox input.mp3 --upload https://teddycloud.example.com --create-custom-json --version-2
|
621
|
+
```
|
622
|
+
|
513
623
|
### Media Tags
|
514
624
|
|
515
625
|
TonieToolbox can read metadata tags from audio files (such as ID3 tags in MP3 files, Vorbis comments in FLAC/OGG files, etc.) and use them to create more meaningful filenames or display information about your audio collection.
|
@@ -666,81 +776,7 @@ tonietoolbox "C:\Music\Classical\Bach" --use-media-tags --name-template "{compos
|
|
666
776
|
The first command shows what tags are available, allowing you to create precise naming templates for classical music collections.
|
667
777
|
|
668
778
|
## Technical Details
|
669
|
-
|
670
|
-
### TAF (Tonie Audio Format) File Structure
|
671
|
-
|
672
|
-
The Tonie Audio Format (TAF) consists of several parts:
|
673
|
-
|
674
|
-
#### 1. Tonie Header (0x1000 bytes)
|
675
|
-
|
676
|
-
Located at the beginning of the file, structured as:
|
677
|
-
|
678
|
-
- A 4-byte big-endian integer specifying the header length
|
679
|
-
- A Protocol Buffer encoded header (defined in `tonie_header.proto`)
|
680
|
-
- Padding to fill the entire 4096 bytes (0x1000)
|
681
|
-
|
682
|
-
The Protocol Buffer structure contains:
|
683
|
-
|
684
|
-
```protobuf
|
685
|
-
message TonieHeader {
|
686
|
-
bytes dataHash = 1; // SHA1 hash of the audio data
|
687
|
-
uint32 dataLength = 2; // Length of the audio data in bytes
|
688
|
-
uint32 timestamp = 3; // Unix timestamp (also used as bitstream serial number)
|
689
|
-
repeated uint32 chapterPages = 4 [packed=true]; // Page numbers for chapter starts
|
690
|
-
bytes padding = 5; // Padding to fill up the header
|
691
|
-
}
|
692
|
-
```
|
693
|
-
|
694
|
-
#### 2. Audio Data
|
695
|
-
|
696
|
-
The audio data consists of:
|
697
|
-
|
698
|
-
- Opus encoded audio in Ogg container format
|
699
|
-
- Every page after the header has a fixed size of 4096 bytes (0x1000)
|
700
|
-
- First page contains the Opus identification header
|
701
|
-
- Second page contains the Opus comments/tags
|
702
|
-
- Remaining pages contain the actual audio data
|
703
|
-
- All pages use the same bitstream serial number (timestamp from header)
|
704
|
-
|
705
|
-
#### 3. Special Requirements
|
706
|
-
|
707
|
-
For optimal compatibility with Tonie boxes:
|
708
|
-
|
709
|
-
- Audio should be stereo (2 channels)
|
710
|
-
- Sample rate must be 48 kHz
|
711
|
-
- Pages must be aligned to 4096 byte boundaries
|
712
|
-
- Bitrate of 96 kbps VBR is recommended
|
713
|
-
|
714
|
-
**Mono audio handling:**
|
715
|
-
|
716
|
-
- By default, TonieToolbox will automatically convert mono audio files to stereo for compatibility.
|
717
|
-
- To disable this behavior (and require your input to already be stereo), use the `--no-mono-conversion` flag.
|
718
|
-
|
719
|
-
### File Analysis
|
720
|
-
|
721
|
-
When using the `--info` flag, TonieToolbox checks and displays detailed information about a .TAF (Tonie Audio File):
|
722
|
-
|
723
|
-
- SHA1 hash validation
|
724
|
-
- Timestamp/bitstream serial consistency
|
725
|
-
- Opus data length verification
|
726
|
-
- Opus header validation (version, channels, sample rate)
|
727
|
-
- Page alignment and size validation
|
728
|
-
- Total runtime
|
729
|
-
- Track listing with durations
|
730
|
-
|
731
|
-
### File Comparison
|
732
|
-
|
733
|
-
When using the `--compare` flag, TonieToolbox provides a detailed comparison of two .TAF files:
|
734
|
-
|
735
|
-
- File size comparison
|
736
|
-
- Header size verification
|
737
|
-
- Timestamp comparison
|
738
|
-
- Data length validation
|
739
|
-
- SHA1 hash verification
|
740
|
-
- Chapter page structure analysis
|
741
|
-
- OGG page-by-page comparison (with `--detailed-compare` flag)
|
742
|
-
|
743
|
-
This is particularly useful for debugging when creating TAF files with different tools or parameters.
|
779
|
+
[Moved to TECHNICAL.md](TECHNICAL.md)
|
744
780
|
|
745
781
|
## Related Projects
|
746
782
|
|
@@ -750,9 +786,6 @@ This project is inspired by and builds upon the work of other Tonie-related open
|
|
750
786
|
- [teddycloud](https://github.com/toniebox-reverse-engineering/teddycloud) - Self-hosted alternative to the Tonie cloud / Boxine cloud for managing custom content
|
751
787
|
- [TeddyCloudStarter](https://github.com/Quentendo64/TeddyCloudStarter) - A Wizard for Docker-based deployment of [teddycloud](https://github.com/toniebox-reverse-engineering/teddycloud)
|
752
788
|
|
753
|
-
## Contributing
|
754
|
-
|
755
|
-
Contributions are welcome! Please feel free to submit a Pull Request.
|
756
789
|
|
757
790
|
## Legal Notice
|
758
791
|
|
@@ -773,3 +806,6 @@ If you need help, have questions, or want to report a bug, please use the follow
|
|
773
806
|
- [GitHub Issues](https://github.com/Quentendo64/TonieToolbox/issues) for bug reports and feature requests
|
774
807
|
- [GitHub Discussions](https://github.com/Quentendo64/TonieToolbox/discussions) for general questions and community support
|
775
808
|
- [HOWTO Guide](HOWTO.md) for common usage instructions
|
809
|
+
|
810
|
+
## Attribution
|
811
|
+
[Parrot Icon created by Freepik - Flaticon](https://www.flaticon.com/free-animated-icons/parrot)
|