Skip to content

Commit

Permalink
Added some examples
Browse files Browse the repository at this point in the history
  • Loading branch information
iluvcapra committed Nov 7, 2023
1 parent 96f79b5 commit 208edd8
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions examples/demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -37,9 +37,19 @@
"source": [
"Once you have a `WavInfoReader`, you can access different metadata systems or \"scopes.\"\n",
"\n",
"The scopes that are presently supported are: `fmt`, `data`, `ixml`, `bext`, `info`, `adm`, `cues`, and `dolby`. Each of these is an attribute of a `WavInfoReader` object.\n",
"The scopes that are presently supported are: \n",
" * `fmt`: sample format, sample rate, bit depth, block alignment, etc.\n",
" * `data`: data chunk description, bytes length and frames length.\n",
" * `ixml`: Gallery Software's iXML metadata, used by production sound recorder equipment and DAWs.\n",
" * `bext`: Broacast-WAV metadata as used by DAWs.\n",
" * `info`: title, artist and description metadata tags, among other items.\n",
" * `adm`: EBU Audio Defintion Model metadata, as used by Dolby Atmos.\n",
" * `cues`: Cue marker metadata, including labels and notes \n",
" * `dolby`: Dolby recorder and playback metadata\n",
"\n",
"Each of these is an attribute of a `WavInfoReader` object.\n",
"\n",
"Each scope roughly corresponds to a vendor-defined metadata system. Many scopes directly represent a specific file *chunk*, like `fmt` or `ixml`, and some may involve data read from many chunks. Examples of this would include `cues` or `adm`.\n"
"Each scope corresponds to a vendor-defined metadata system. Many scopes directly represent a specific file *chunk*, like `fmt` or `ixml`, and some may involve data read from many chunks. Examples of this would include `cues` or `adm`.\n"
]
},
{
Expand All @@ -60,7 +70,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -69,7 +79,7 @@
"(240239, 1441434)"
]
},
"execution_count": 4,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -87,7 +97,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -96,7 +106,7 @@
"(48000, 2, 6, 24)"
]
},
"execution_count": 5,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -116,7 +126,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -166,7 +176,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -202,7 +212,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -231,12 +241,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"There are also convenience methods to get the appropriate label and note for a given marker. (Note here also `WavInfoReader`'s facility for overriding default text encodings.)"
"There is also a convenience method to get the appropriate label and note for a given marker. (Note here also `WavInfoReader`'s facility for overriding default text encodings.)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand All @@ -245,24 +255,28 @@
"text": [
"Cue ID: 1\n",
" Label: Marker 1\n",
" At: 1000\n",
" Note: <NO NOTE>\n",
"Cue ID: 2\n",
" Label: Marker 2\n",
" At: 5000\n",
" Note: Marker Comment 1\n",
"Cue ID: 3\n",
" Label: Marker 3\n",
" At: 10000\n",
" Note: Лорем ипсум долор сит амет, тимеам вивендум хас ет, цу адолесценс дефинитионес еам.\n"
]
}
],
"source": [
"path = \"../tests/test_files/cue_chunks/izotoperx_cues_test.wav\"\n",
"info = WavInfoReader(path, info_encoding=\"utf-8\")\n",
"info = WavInfoReader(path, info_encoding=\"utf-8\") # iZotope RX seems to encode marker text as UTF-8\n",
"\n",
"for cue in info.cues.each_cue():\n",
" print(f\"Cue ID: {cue[0]}\")\n",
" label, note = info.cues.label_and_note(cue[0])\n",
" print(f\" Label: {label}\")\n",
" print(f\" At: {cue[1]}\")\n",
" print(f\" Note: {note or '<NO NOTE>'}\")"
]
},
Expand Down

0 comments on commit 208edd8

Please sign in to comment.