Browse Source

week2day5

pull/232/head
Phi-Li-Ne 2 months ago
parent
commit
b811f1bce7
  1. 28
      week2/day5.ipynb

28
week2/day5.ipynb

@ -279,7 +279,7 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"image = artist(\"New York City\")\n", "image = artist(\"Berlin\")\n",
"display(image)" "display(image)"
] ]
}, },
@ -449,7 +449,7 @@
" # Play the generated audio\n", " # Play the generated audio\n",
" display(Audio(output_filename, autoplay=True))\n", " display(Audio(output_filename, autoplay=True))\n",
"\n", "\n",
"talker(\"Well, hi there\")" "talker(\"Holla die Waldfee\")"
] ]
}, },
{ {
@ -478,7 +478,7 @@
" temp_path = os.path.join(temp_dir, \"temp_audio.wav\")\n", " temp_path = os.path.join(temp_dir, \"temp_audio.wav\")\n",
" try:\n", " try:\n",
" audio_segment.export(temp_path, format=\"wav\")\n", " audio_segment.export(temp_path, format=\"wav\")\n",
" time.sleep(3) # Student Dominic found that this was needed. You could also try commenting out to see if not needed on your PC\n", " #time.sleep(3) # Student Dominic found that this was needed. You could also try commenting out to see if not needed on your PC\n",
" subprocess.call([\n", " subprocess.call([\n",
" \"ffplay\",\n", " \"ffplay\",\n",
" \"-nodisp\",\n", " \"-nodisp\",\n",
@ -508,7 +508,13 @@
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "96f90e35-f71e-468e-afea-07b98f74dbcf", "id": "96f90e35-f71e-468e-afea-07b98f74dbcf",
"metadata": {}, "metadata": {
"editable": true,
"slideshow": {
"slide_type": ""
},
"tags": []
},
"source": [ "source": [
"## PC Variation 3" "## PC Variation 3"
] ]
@ -548,6 +554,20 @@
"talker(\"Well hi there\")" "talker(\"Well hi there\")"
] ]
}, },
{
"cell_type": "code",
"execution_count": null,
"id": "4bd65a9b-f79c-4f01-9e0b-0a7bf5f43e81",
"metadata": {},
"outputs": [],
"source": [
"from IPython.display import Audio\n",
"\n",
"# Use a simple audio file for testing\n",
"audio = Audio(url=\"https://www.soundhelix.com/examples/mp3/SoundHelix-Song-1.mp3\")\n",
"display(audio)"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "e821224c-b069-4f9b-9535-c15fdb0e411c", "id": "e821224c-b069-4f9b-9535-c15fdb0e411c",

Loading…
Cancel
Save