Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Why Doesn’t Anyone Use My Library?

Why Doesn’t Anyone Use My Library?

When, why, and how to open source code, and how to get it into real-world use. Lessons learned working on Pydub (audio for humans, a la requests). It's grown to incorporate contributions from around the world, over 1000 stars on GitHub and the nicest API you'll find this side of the DAC.

James Robert

August 15, 2015
Tweet

Other Decks in Technology

Transcript

  1. HOW TO BUILD SOMETHING USEFUL AND HELP IT GAIN ADOPTION

    BY NURTURING IT FOR YEARS AND NOT BITING OFF MORE THAN YOU CAN CHEW.
  2. 3 REASONS 1. They’ve never heard of it 2. It

    doesn’t fit their needs 3. Using something else instead
  3. THIS’LL BE EASY sound1 = open(“talking.wav”, “rb”).read() sound2 = open(“music.mp3”,

    “rb”).read() combined = sound1 + sound2 out_f = open(“this_will_totally_work.???”, “wb”)
  4. THIS’LL BE EASY sound1 = open(“talking.wav”, “rb”).read() sound2 = open(“music.mp3”,

    “rb”).read() combined = sound1 + sound2 out_f = open(“this_will_totally_work.MP3”, “wb”) out_f.write(combined)
  5. THIS’LL BE EASY sound1 = open(“talking.wav”, “rb”).read() sound2 = open(“music.WAV”,

    “rb”).read() combined = sound1 + sound2 out_f = open(“this_will_totally_work.WAV”, “wb”) out_f.write(combined)
  6. THIS’LL BE EASY # coding: -*- utf-8 -*- import wave

    sound1 = wave.open(“talking.wav”, “rb”) sound2 = wave.open(“music.wav”, “rb”) out_f = wave.open(“this_will_totally_work.WAV”, “wb”) # Who even knows what this does ¯\_()_/¯ out_f.setparams(sound1.getparams()) # manual accounting ಠ_ಠ sound1_frames = sound1.getnframes() sound2_frames = sound2.getnframes() out_f.setnframes(sound1_frames + sound2_frames) out_f.writeframes(sound1.readframes(sound1_frames)) out_f.writeframes(sound2.readframes(sound2_frames)) out_f.close()
  7. THIS’LL BE EASY ▸ Channels (Mono, Stereo) ▸ Sample Rate

    (44.1 kHz, 48 kHz, 22,050 kHz, …0 ▸ Bit depth (8 / 16 / 24 / 32 bit)
  8. THIS’LL BE EASY import wave import audioop sound1 = wave.open(“talking.wav”,

    “rb”) sound2 = wave.open(“music.wav”, “rb”) out_f = wave.open(“this_will_totally_work.WAV”, “wb”) sound1_frames = sound1.getnframes() sound2_frames = sound2.getnframes() sound1_data = sound1.readframes(sound1_frames) sound2_data = sound2.readframes(sound2_frames) sound2_data_converted, _ = audioop.ratecv( sound2_data, sound2.getsampwidth(), sound2.getnchannels(), sound2.getframerate(), sound1.getframerate(), None ) out_f.setparams(sound1.getparams()) out_f.setnframes(sound1_frames + sound2_frames) out_f.writeframes(sound1_data) out_f.writeframes(sound2_data_converted) out_f.close()
  9. 3 REASONS 1. They’ve never heard of it 2. It

    doesn’t fit their needs 3. Using something else instead
  10. 3. THEY’RE USING SOMETHING ELSE ▸ What are people using

    now? ▸ What are the criticisms? ▸ What do they like?
  11. from pydub import AudioSegment sound1 = AudioSegment.from_wav(“sound.wav”) sound2 = AudioSegment.from_mp3(“music.mp3”)

    combined = sound1.append(sound2, crossfade=1000) combined.export(“tada.mp3”, format=“mp3”)
  12. Opportunity is missed by most people because it is dressed

    in overalls and looks like work. ▸ Thomas Edison
  13. Opportunity is missed by most people because it is dressed

    in overalls and looks like work. ▸ Henry Dodd
  14. Opportunity is missed by most people because it is dressed

    in overalls and looks like work. ▸ Anonymous
  15. The successful man was out and on the job long

    before opportunity came a-knocking. And this same opportunity, by the way, is ofttimes disguised as hard work ▸ Anonymous
  16. GITHUB ▸ octopress: Barebones landing page ▸ issues: Bugs/Features ▸

    docs: markdown files in the repo ▸ AUTHORS file: has my email and twitter
  17. RECAP ▸ Solve a real problem ▸ Nice API ▸

    Don’t overcommit ▸ Keep showing up