-
Notifications
You must be signed in to change notification settings - Fork 1
Platform Notes
Platform-specific considerations and optimizations for hAudiotagger.
hAudiotagger provides a consistent API across all platforms. However, there are some platform-specific behaviors and optimizations to be aware of.
No special permissions are required for reading/writing audio metadata. hAudiotagger uses the app's storage access.
- File path API — Best performance. Rust reads files directly.
- Bytes API — Slightly slower due to data transfer across FFI.
- Batch operations — Use file path API for maximum throughput.
If you're using SAF (Storage Access Framework) to pick files, you'll need to read the file bytes first:
final file = await FilePicker.platform.pickFiles();
final bytes = await File(file!.files.first.path!).readAsBytes();
final tag = await Haudiotagger.readFromBytes(bytes);No special permissions required for metadata access.
iOS uses iTunes-style metadata (ilst). hAudiotagger fully supports reading and writing iTunes metadata fields.
Similar to Android — file path API is faster than bytes API.
Linux gets the best performance due to:
- Direct file system access
- Rayon parallelism for batch operations
- No sandbox restrictions
No system dependencies required. hAudiotagger bundles its own native libraries.
Similar to Linux with full rayon parallelism support.
If your app uses App Sandbox, ensure you have the appropriate entitlements for file access:
<key>com.apple.security.files.user-selected.read-write</key>
<true/>Full performance with rayon parallelism.
Use forward slashes or escaped backslashes:
// Correct
await Haudiotagger.read('C:/Music/song.mp3');
await Haudiotagger.read('C:\\Music\\song.mp3');-
No file path API — Use
*FromBytesvariants only - Single-threaded — No rayon parallelism
- WASM required — Must enable cross-origin isolation
Web is slower than native due to:
- WASM overhead
- Data serialization across FFI
- Single-threaded execution
For large batch operations, consider using native platforms.
Users must select files via file picker:
final result = await FilePicker.platform.pickFiles(type: FileType.audio);
final bytes = result.files.first.bytes;
final tag = await Haudiotagger.readFromBytes(bytes!);See Web Setup for detailed configuration.
| Operation | Native (100 files) | Web (100 files) |
|---|---|---|
| Read | 1,282 f/s | ~77 f/s |
| Write | 197 f/s | ~30 f/s |
| Update | 197 f/s | ~20 f/s |
f/s = files per second
- Use file path API on native — Always prefer file path over bytes on native platforms
- Use bytes API on web — File paths are not available on web
-
Batch operations — Use
batchWriteorbatchUpdatefor multiple files -
Read field when possible — Use
readFieldinstead ofreadwhen you only need one value - Preview before write — Use pipeline preview to see changes before applying
Made with ❤️ and 🦀 by Hirdaya Shrestha