From 208edd8bdc4808fbbfdb03d79a4e41e1b38d3418 Mon Sep 17 00:00:00 2001 From: Jamie Hardt Date: Tue, 7 Nov 2023 00:32:19 -0800 Subject: [PATCH] Added some examples --- examples/demo.ipynb | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/examples/demo.ipynb b/examples/demo.ipynb index f478d1d..f05ac2b 100644 --- a/examples/demo.ipynb +++ b/examples/demo.ipynb @@ -20,7 +20,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -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" ] }, { @@ -60,7 +70,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -69,7 +79,7 @@ "(240239, 1441434)" ] }, - "execution_count": 4, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -87,7 +97,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -96,7 +106,7 @@ "(48000, 2, 6, 24)" ] }, - "execution_count": 5, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -116,7 +126,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -166,7 +176,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -202,7 +212,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 6, "metadata": {}, "outputs": [ { @@ -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": [ { @@ -245,24 +255,28 @@ "text": [ "Cue ID: 1\n", " Label: Marker 1\n", + " At: 1000\n", " 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 ''}\")" ] },