Slide 1

Slide 1 text

WHY DOESN’T ANYONE USE MY LIBRARY?

Slide 2

Slide 2 text

OR…

Slide 3

Slide 3 text

HOW TO BUILD SOMETHING USEFUL AND HELP IT GAIN ADOPTION BY NURTURING IT FOR YEARS AND NOT BITING OFF MORE THAN YOU CAN CHEW.

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

@JIAARO

Slide 6

Slide 6 text

WHY DOESN’T ANYONE USE MY LIBRARY?

Slide 7

Slide 7 text

3 REASONS

Slide 8

Slide 8 text

3 REASONS 1. They’ve never heard of it

Slide 9

Slide 9 text

3 REASONS 1. They’ve never heard of it 2. It doesn’t fit their needs

Slide 10

Slide 10 text

3 REASONS 1. They’ve never heard of it 2. It doesn’t fit their needs 3. Using something else instead

Slide 11

Slide 11 text

STORY TIME

Slide 12

Slide 12 text

THIS’LL BE EASY sound1 = open(“talking.wav”, “rb”).read()

Slide 13

Slide 13 text

THIS’LL BE EASY sound1 = open(“talking.wav”, “rb”).read() sound2 = open(“music.mp3”, “rb”).read()

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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”)

Slide 16

Slide 16 text

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)

Slide 17

Slide 17 text

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)

Slide 18

Slide 18 text

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()

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

RE-EVALUATE MY DECISIONS AND/OR LIFE

Slide 21

Slide 21 text

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)

Slide 22

Slide 22 text

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()

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

3 REASONS 1. They’ve never heard of it 2. It doesn’t fit their needs 3. Using something else instead

Slide 27

Slide 27 text

3. THEY’RE USING SOMETHING ELSE

Slide 28

Slide 28 text

3. THEY’RE USING SOMETHING ELSE ▸ What are people using now? ▸ What are the criticisms? ▸ What do they like?

Slide 29

Slide 29 text

A GOOD API is worth it

Slide 30

Slide 30 text

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”)

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

Showing up is 80 percent of life. ▸ Woody Allen

Slide 36

Slide 36 text

Showing up is 80 percent of life. ▸ Marshall Brickman

Slide 37

Slide 37 text

Showing up is 80 percent of life. ▸ Woody Allen

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

BUILD Libraries, NOT FRAMEWORKS

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

DON’T BITE OFF MORE THAN YOU CAN CHEW

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

1. Github 2. Stack Overflow: pydub tag via RSS 3. PyPI: for pip install

Slide 46

Slide 46 text

GITHUB ▸ octopress: Barebones landing page ▸ issues: Bugs/Features ▸ docs: markdown files in the repo ▸ AUTHORS file: has my email and twitter

Slide 47

Slide 47 text

1. Github 2. Stack Overflow: pydub tag via RSS 3. PyPI: for pip install

Slide 48

Slide 48 text

THE LONG HAUL

Slide 49

Slide 49 text

DON’T FORGET ABOUT YOUR RESEARCH

Slide 50

Slide 50 text

STORY TIME (CONTINUED)

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

LUCK

Slide 53

Slide 53 text

RECAP

Slide 54

Slide 54 text

RECAP ▸ Solve a real problem

Slide 55

Slide 55 text

RECAP ▸ Solve a real problem ▸ Nice API

Slide 56

Slide 56 text

RECAP ▸ Solve a real problem ▸ Nice API ▸ Don’t overcommit

Slide 57

Slide 57 text

RECAP ▸ Solve a real problem ▸ Nice API ▸ Don’t overcommit ▸ Keep showing up

Slide 58

Slide 58 text

THANKS! James Robert @jiaaro pydub.com [email protected] [email protected]