Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update installation of libsndfile, add unitest of soundfile #177

Merged
merged 4 commits into from
Jul 28, 2017

Conversation

luotao1
Copy link
Contributor

@luotao1 luotao1 commented Jul 26, 2017

  1. 将SoundFile移到requirements.txt中安装。因为安装时不依赖libsndfile,只有使用时会依赖。
  2. 如果系统中已经有libsndfile,则不安装。反之下载源码并安装系统路径。
    • 这里只能安装到系统路径,因为ctypes.util.find_library()只在系统路径中查找libsndfile库。
    • 在docker环境中,可以安装到系统路径。
  3. 增加soundfile.read/write的单测。

@luotao1 luotao1 requested review from xinghai-sun and pkuyym and removed request for xinghai-sun July 26, 2017 09:55
@luotao1 luotao1 force-pushed the setup branch 4 times, most recently from a38265e to 13e3cf8 Compare July 28, 2017 09:02
Copy link
Contributor

@pkuyym pkuyym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM++

file = 'test.wav'
sf.write(file, data, 44100, format='WAV', subtype='FLOAT')
read, fs = sf.read(file)
assert np.all(read == data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use self.assertEqual or self.assertTrue instead of assert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

sf.write(file, data, 44100, format='WAV', subtype='FLOAT')
read, fs = sf.read(file)
assert np.all(read == data)
assert fs == 44100
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use self.assertEqual instead of assert

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@luotao1 luotao1 changed the title install libsndfile from /usr to thirdparty update installation of libsndfile, add unitest of soundfile Jul 28, 2017
@luotao1 luotao1 merged commit 57e58ef into PaddlePaddle:develop Jul 28, 2017
@luotao1 luotao1 deleted the setup branch July 28, 2017 11:22
@xinghai-sun xinghai-sun mentioned this pull request Aug 1, 2017
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants