Skip to content

Conversation

@Jake-Prickett
Copy link
Contributor

Recently wrote a blog post about gRPC Swift using SwiftNIO, created this example app to help highlight some capabilities.

After publishing it, noticed this recently closed PR: #516, which implemented the same example app with a suggestion to use the NIO Implementation. Implemented a few other suggestions as well from the PR.

Partial Credit: @timburks

@glbrntt glbrntt self-requested a review April 30, 2020 08:20
Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

Thanks for doing this Jake, this is really cool! I've left some notes in line.

@Jake-Prickett Jake-Prickett force-pushed the cocoapods-bidirectional-streaming-example branch from 7de8c57 to aba7190 Compare May 4, 2020 01:28
@Jake-Prickett Jake-Prickett force-pushed the cocoapods-bidirectional-streaming-example branch from aba7190 to 8c44608 Compare May 5, 2020 00:48
Copy link
Collaborator

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

I have a few more documentation nits but otherwise this looks good to me. @MrMage do you want to take a look?

Copy link
Collaborator

@MrMage MrMage left a comment

Choose a reason for hiding this comment

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

Great example! I have just added a few nits that reflect my personal style preference; feel free to ignore them. I must also admit that I have not looked at George's comments...

If you have an extra 5-10 minutes to spare, I would love to see a video of this app in action without having to compile it myself. For example, just connect your device to your Mac, and record the device screen with QuickTime player while using the app. (Or just do an on-device screen recording, that would probably be even easier.) Again, completely optional!

}

class AudioStreamManager {

Copy link
Collaborator

Choose a reason for hiding this comment

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

my preference is not to have a newline at the beginning of a class, but up to you (same goes for the method implementations below)

static var shared = AudioStreamManager()

private let bus1: AudioUnitElement = 1
private var oneFlag: UInt32 = 1
Copy link
Collaborator

Choose a reason for hiding this comment

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

could that variable be local to the method where it is used? If not, document this variable and maybe the other ones as well? (Same goes for bus1 above.)


private func configureAudioSession() {
let session = AVAudioSession.sharedInstance()
try? session.setCategory(.record)
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we make this method throw instead?

// Send audio data
call.sendMessage(streamAudioDataRequest, promise: nil)

case .streaming(let stream):
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is called call above; unify the two variable names?

@Jake-Prickett
Copy link
Contributor Author

Thanks for the review @glbrntt & @MrMage! I've attached a quick sample for your reference, and also there is a compressed gif I put in the sample project as well..

SpeechToText.zip

@glbrntt
Copy link
Collaborator

glbrntt commented May 15, 2020

Sorry @Jake-Prickett; I missed the notification with your updates from ~a week a go. I'm happy with this, just wanted to check that @MrMage is happy with this too before merging?

@MrMage
Copy link
Collaborator

MrMage commented May 15, 2020

👌 from me

@glbrntt glbrntt merged commit 1eb0017 into grpc:master May 15, 2020
@Jake-Prickett
Copy link
Contributor Author

No worries! Thanks for the merge!

@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants