{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# The sound Of Hydrogen" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Inspired by [minutephysics](https://www.youtube.com/watch?v=qyi5SvPlMXc), and the explanation do do it in mathematica: [The sound of hydrogen](https://www.youtube.com/watch?v=IhvW8yZdE5A).\n", "\n", "The goal of this notebook is to show how one can play a sound file in notebook, using Html5 <audio> tag to play it dirrectly inside the browser.\n", "\n", "To do this we use the spectrum of hydrogen that we shift the into the audible range. You can listen to it in the last cell of this notebook.\n", "Wait a few second if you are on nbviewer, the notebook is not light (someone to update it to use mp3? ogg? or a compressed format?)\n", "\n", "Please be aware that the html5 player is not working on some old browser and IE." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\\[Edit\\] apparently the process of converting something not audible into sound have diffent naming: sonify,\n", "sonification or auralizing according to the comment on twitter." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "from __future__ import division, print_function, absolute_import\n", "import scipy.constants as const\n", "import numpy as np\n", "import scipy\n", "\n", "from matplotlib.pyplot import plot\n", "from scipy.io import wavfile\n", "from IPython.core.display import HTML, display" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [], "source": [ "# this is a wrapper that take a filename and publish an html