Discussion:
[LAD] How do I write meta data into a wave file? (Command line tools?)
Nils Gey
2013-05-04 01:01:11 UTC
Permalink
Hello list,

libsndfile-info shows various useful information like the one at the end of this mail.
I have Sonatina Symphonic Orchestra waves here (violins 1) and a one note wave includes "Midi Note", "Loop Count" and "Cue Start : 92078 End : 223977", which is the actual loop start/end

Is this custom data or does it follow a standard?
And no matter what, how do I write that into my own wave files?

I would prefer command line tools. But programming interfaces are fine as well.

Greetings,
Nils

$ sndfile-info test.wav

Version : libsndfile-1.0.25

========================================
File : test.wav
Length : 896548
RIFF : 896540
WAVE
fmt : 16
Format : 0x1 => WAVE_FORMAT_PCM
Channels : 2
Sample Rate : 44100
Block Align : 4
Bit Width : 16
Bytes/sec : 176400
data : 895916
*** SAUR : 512 (unknown marker)
smpl : 60
Manufacturer : 0
Product : 0
Period : 22675 nsec
Midi Note : 76
Pitch Fract. : 0
SMPTE Format : 0
SMPTE Offset : 00:00:00 00
Loop Count : 1
Cue ID : 0 Type : 0 Start : 92078 End : 223977 Fraction : 0 Count : 0
Sampler Data : 0
End

----------------------------------------
Sample Rate : 44100
Frames : 223979
Channels : 2
Format : 0x00010002
Sections : 1
Seekable : TRUE
Duration : 00:00:05.079
Signal Max : 31468 (-0.35 dB)
Joel Roth
2013-05-04 02:29:03 UTC
Permalink
Post by Nils Gey
Hello list,
libsndfile-info shows various useful information like the one at the end of this mail.
I have Sonatina Symphonic Orchestra waves here (violins 1) and a one note wave includes "Midi Note", "Loop Count" and "Cue Start : 92078 End : 223977", which is the actual loop start/end
Is this custom data or does it follow a standard?
And no matter what, how do I write that into my own wave files?
I would prefer command line tools. But programming interfaces are fine as well.
Nils and all,

Wikipedia says:

Metadata

As a derivative of RIFF, WAV files can be tagged with
metadata in the INFO chunk. In addition, WAV files can embed
Extensible Metadata Platform (XMP) data. Applications may
not handle this extra information or may expect to see it in
a particular place. Although the RIFF specification requires
that applications ignore chunks they do not recognize, some
applications are confused by additional chunks.[citation
needed]

Is it possible these "standards" could be among those the
courts humbly bid that Microsoft open to the uncouth gaze of
slobbering masses? (Providing court-ordered data on file
formats used internally is an area that seems to attract
the most lackadaisical and error prone MS employees.)

Otherwise, there is plenty of code to study.

This parser reveals what data structures it expects...
if you speak C.

https://metacpan.org/source/AGRUNDMA/Audio-Scan-0.93/src/wav.c

Here is a metadata parser/writer for diverse file types.

https://metacpan.org/module/EXIFTOOL/Image-ExifTool-9.27/exiftool


HTH,

Joel
Post by Nils Gey
Greetings,
Nils
$ sndfile-info test.wav
Version : libsndfile-1.0.25
========================================
File : test.wav
Length : 896548
RIFF : 896540
WAVE
fmt : 16
Format : 0x1 => WAVE_FORMAT_PCM
Channels : 2
Sample Rate : 44100
Block Align : 4
Bit Width : 16
Bytes/sec : 176400
data : 895916
*** SAUR : 512 (unknown marker)
smpl : 60
Manufacturer : 0
Product : 0
Period : 22675 nsec
Midi Note : 76
Pitch Fract. : 0
SMPTE Format : 0
SMPTE Offset : 00:00:00 00
Loop Count : 1
Cue ID : 0 Type : 0 Start : 92078 End : 223977 Fraction : 0 Count : 0
Sampler Data : 0
End
----------------------------------------
Sample Rate : 44100
Frames : 223979
Channels : 2
Format : 0x00010002
Sections : 1
Seekable : TRUE
Duration : 00:00:05.079
Signal Max : 31468 (-0.35 dB)
_______________________________________________
Linux-audio-dev mailing list
http://lists.linuxaudio.org/listinfo/linux-audio-dev
--
Joel Roth
Erik de Castro Lopo
2013-05-04 04:04:21 UTC
Permalink
Post by Nils Gey
Hello list,
libsndfile-info shows various useful information like the one at the end of this mail.
I have Sonatina Symphonic Orchestra waves here (violins 1) and a one note wave includes "Midi Note", "Loop Count" and "Cue Start : 92078 End : 223977", which is the actual loop start/end
Is this custom data or does it follow a standard?
And no matter what, how do I write that into my own wave files?
I would prefer command line tools. But programming interfaces are fine as well.
sndfile-metadata-set --help
Usage :

sndfile-metadata-set [options] <file>
sndfile-metadata-set [options] <input file> <output file>

Where an option is made up of a pair of a field to set (one of
the 'bext' or metadata fields below) and a string. Fields are
as follows :

--bext-description Set the 'bext' description.
--bext-originator Set the 'bext' originator.
--bext-orig-ref Set the 'bext' originator reference.
--bext-umid Set the 'bext' UMID.
--bext-orig-date Set the 'bext' origination date.
--bext-orig-time Set the 'bext' origination time.
--bext-coding-hist Set the 'bext' coding history.
--bext-time-raf Set the 'bext' Time ref.

--str-comment Set the metadata comment.
--str-title Set the metadata title.
--str-copyright Set the metadata copyright.
--str-artist Set the metadata artist.
--str-date Set the metadata date.
--str-album Set the metadata album.
--str-license Set the metadata license.

There are also the following arguments which do not take a
parameter :

--bext-auto-time-date Set the 'bext' time and date to current time/date.
--bext-auto-time Set the 'bext' time to current time.
--bext-auto-date Set the 'bext' date to current date.
--str-auto-date Set the metadata date to current date.

Most of the above operations can be done in-place on an existing
file. If any operation cannot be performed, the application will
exit with an appropriate error message.

Erik
--
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/
Federico Lopez
2013-05-04 14:34:01 UTC
Permalink
Post by Nils Gey
Hello list,
libsndfile-info shows various useful information like the one at the end of this mail.
I have Sonatina Symphonic Orchestra waves here (violins 1) and a one note wave includes "Midi Note", "Loop Count" and "Cue Start : 92078 End : 223977", which is the actual loop start/end
Is this custom data or does it follow a standard?
And no matter what, how do I write that into my own wave files?
May be offtopic .. you can insert any obscure poetry or any
non-stardard text in a wav file via steganography.

http://steghide.sourceforge.net/documentation.php
Post by Nils Gey
I would prefer command line tools. But programming interfaces are fine as well.
Greetings,
Nils
$ sndfile-info test.wav
Version : libsndfile-1.0.25
========================================
File : test.wav
Length : 896548
RIFF : 896540
WAVE
fmt : 16
Format : 0x1 => WAVE_FORMAT_PCM
Channels : 2
Sample Rate : 44100
Block Align : 4
Bit Width : 16
Bytes/sec : 176400
data : 895916
*** SAUR : 512 (unknown marker)
smpl : 60
Manufacturer : 0
Product : 0
Period : 22675 nsec
Midi Note : 76
Pitch Fract. : 0
SMPTE Format : 0
SMPTE Offset : 00:00:00 00
Loop Count : 1
Cue ID : 0 Type : 0 Start : 92078 End : 223977 Fraction : 0 Count : 0
Sampler Data : 0
End
----------------------------------------
Sample Rate : 44100
Frames : 223979
Channels : 2
Format : 0x00010002
Sections : 1
Seekable : TRUE
Duration : 00:00:05.079
Signal Max : 31468 (-0.35 dB)
_______________________________________________
Linux-audio-dev mailing list
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Loading...