This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const textToSpeech = require('@google-cloud/text-to-speech'); | |
const fs = require('fs'); | |
async function streamTextToSpeech(texts: string[]) { | |
const client = new textToSpeech.TextToSpeechClient(); | |
const ttsStream = client.streamingSynthesize(); | |
// Write the response to a file, replace with your desired output stream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension NSDate { | |
convenience init(ISO8601:String) { | |
let dateStringFormatter = NSDateFormatter() | |
dateStringFormatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" | |
dateStringFormatter.locale = NSLocale.systemLocale() | |
let d = dateStringFormatter.dateFromString(ISO8601) | |
self.init(timeInterval:0, sinceDate:d!) | |
} | |
class func getLastDayOfMonthFrom(month:Int,year:Int) -> NSDate { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)isSameDayWithDateOne:(NSDate *)dateOne dateTwo:(NSDate *)dateTwo{ | |
NSCalendar *calender = [NSCalendar currentCalendar]; | |
unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit; | |
NSDateComponents *compOne = [calender components:unitFlags fromDate:dateOne]; | |
NSDateComponents *compTwo = [calender components:unitFlags fromDate:dateTwo]; | |
return ([compOne day] == [compTwo day] && [compOne month] == [compTwo month] && [compOne year] == [compTwo year]); |