Skip to content

Sound: removed play() in favor of play_file() - #552

Merged
dwalton76 merged 4 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:playfile-takeII
Nov 7, 2018
Merged

dwalton76 merged 4 commits into
ev3dev:ev3dev-stretchfrom
dwalton76:playfile-takeII

Conversation

@dwalton76

Copy link
Copy Markdown
Collaborator

For issue #532

@WasabiFan WasabiFan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think there are code examples in this file and maybe in other docs pages which use the old method name; those also need to be updated. Looks good to me otherwise.

Comment thread ev3dev2/sound.py Outdated
if not 0 < volume <= 100:
raise ValueError('invalid volume (%s)' % volume)

if wav_file.endswith(".mp3"):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not require that it does end in .wav rather than not ending in .mp3?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was worried about breaking things if someone had a wav file that did not end in .wav. That would be pretty silly though...will change it to enforce .wav.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I come from the Windows world where file extensions are used for a lot of logic, so maybe my POV is different. wav files without extensions might be common, I'm not sure.

@WasabiFan

Copy link
Copy Markdown
Member

I think example code needs to be updated too.

@dwalton76

Copy link
Copy Markdown
Collaborator Author

Fixed the example in the docstring

@dwalton76
dwalton76 merged commit f3fe81e into ev3dev:ev3dev-stretch Nov 7, 2018
@dwalton76
dwalton76 deleted the playfile-takeII branch November 7, 2018 11:20
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