joereddington / MrsLandingham

An exercise in working out what my workflow actually is.
0 stars 1 forks source link

Mrs landingaham to play music if time hits a specific future time #15

Closed joereddington closed 6 years ago

joereddington commented 6 years ago

This is how we do the reminders, by finding out what the time will be in 5:00 and then checking how close we are to the current time...

Here's how you do the sound:

https://stackoverflow.com/a/31768957/170243

joereddington commented 6 years ago
08/09/17 18:48 to 19:31:

This is a sprint designed to get Mrs Landingham to play music at specific time queues. The first thing to do is to get Mrs Landingham to Play sounds at all.

We leaded a few things in the process. Firstly we learned that if the player is given a filepath that isn't valid, then it crashes our app (which at least gives us an

I'm here and this is what I want.

First order of buisness - get it to play a sound when you press a button.

18:50:

Stackoverflow instantly raises the question - 'how do you store a sound file on the watch...

18:58:

I've given a random attempt, we'll see how it works (if it fails, I can put something onto stackoverflow)

19:03:

Hmm. Running on watch, and loading sign. But nothing coming up. Let's have another look.

19:04:

There's some debug:

2017-09-08 19:03:49.111732+0100 Mrs Landingham WatchKit Extension[516:2501915] [default] -[WKAudioFileAsset _initWithURL:title:albumTitle:artist:]_block_invoke:39: Received title: ring.wav

19:08:

Let's try it with silent mode off...

19:08:

Nope...

19:11:

Trying with absolute path to sound.

19:16:

I think I NSLog broke therthing...

19:26:

Okay, since I put in the full path I'm getting it crashing every time. That's unhelpful.

19:31:

Trying the name 'bing' also broke everything...

10/09/17 17:39:

So the implication is that this must be correctly identifying the file - if I change the path even slightly it completely breaks.

So the question becomes. Why is it NOT making a noise?

17:43:

So https://stackoverflow.com/questions/30744166/playing-sound-in-apple-watchkit suggests that I need to do most of the work in the awake section. Let's try that.

17:47:

I've moved the declaration to be a class variable, and put most of the intialisation code into the awakeWithContext file.

17:48:

It worked!

17:48:

Wait, it worked exactly once...Hmmm.

17:56:

Ah - it works exactly once each time that we go into this interface. Hmmm.

17:57:

I'm trying a backwards way of doing it in case that helps.

18:01:

It did and I've committed, it's still only working thought the bluetooth headphones tho..

18:04:

Some argument in the comments here: https://stackoverflow.com/questions/28980152/play-sound-from-apple-watch-speaker