in January I created a project in DSX that was linked to a Bluemix Object Storage. Audio file arriving from Watson IoT platform were saved in this Object Storage and they were loaded automatically in the DSX files section of the project. I'm no more able to recreate a new project with the same functionality: I'm no more able to add data service and if I configure Object storage it appears as target and not as source. I need to read .wav files and process them with numpy in a Python notebook. Any advise?
2 Answers
Can you add a bit more detail? I don't understand what is the issue:
- You cannot create new projects in DSX associated to Object Storage?
- You wav files are not automatically showing in the DSx Project?

- 644
- 1
- 4
- 19
-
THe problem is that I do not have wav files arriving automatically in DSX. – Dani Jun 09 '17 at 08:02
I am assuming you are trying to read .wav file that you uploaded to object storage.
For reading wave format files you would need library like scipy.
scipy library allows you read wav file from file source.
https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.io.wavfile.read.html
For reading data from object storage, you need to use requests and then you would need to save content to GPFS as a file so that you can use it in scipy's read function.
scipy.io.wavfile.read('samplewavefile1.wav')
Then you can use numpy to do whatever you want to How to manipulate wav file data in Python?
import numpy as np
import scipy.io.wavfile
rate, data = scipy.io.wavfile.read('samplewavefile1.wav')
sin_data = np.sin(data)
print sin_data
Here is link to complete notebook:- https://github.com/charles2588/bluemixsparknotebooks/blob/master/Python/ReadBinaryfilesfromObjectStorage.ipynb

- 1
- 1

- 2,145
- 10
- 15