This file contains 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
import "./styles.css"; | |
import { useEffect, useState } from "react"; | |
import * as Tone from "tone"; | |
export default function App() { | |
const [filter, setFilter] = useState<Tone.PitchShift | undefined>(undefined); | |
const [pitch, setPitch] = useState(1); | |
async function init() { | |
const stream = await navigator.mediaDevices.getUserMedia({ audio: true }); |
This file contains 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
import "./styles.css"; | |
import { useEffect, useRef, useState } from "react"; | |
import * as Tone from "tone"; | |
export default function App() { | |
const [filter, setFilter] = useState<Tone.PitchShift | undefined>(undefined); | |
const [pitch, setPitch] = useState(1); | |
const audioRef = useRef<any>(); | |
async function init() { |
This file contains 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
import "./styles.css"; | |
import { useEffect, useRef, useState } from "react"; | |
import * as Tone from "tone"; | |
export default function App() { | |
const [filter, setFilter] = useState<Tone.PitchShift | undefined>(undefined); | |
const [pitch, setPitch] = useState(1); | |
const audioRef = useRef<any>(); | |
async function init() { |
This file contains 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
// Pitch change without affecting duration | |
./ffmpeg -i elle-raw.mp3 -af "asetrate=48000*0.8, aresample=48000, atempo=1/0.8" track1.mp3 | |
// Merge tracks | |
./ffmpeg -i elle-raw.mp3 -i track1.mp3 -filter_complex amix=inputs=2:duration=longest output.mp3 |
This file contains 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
export default function validate<T>(schema: T) { | |
const {errors} = Joi.object<T>(schema); // You can use T type here | |
} | |
const validate: <T>(schema: T) => void = () => { | |
const {errors} = Joi.object<T>(schema); // You can't use T type here | |
} |
This file contains 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
auth | |
validation | |
database |
This file contains 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
Initiate CALLER. | |
Create data channel. | |
CALLER - Create offer. | |
CALLER - Set the offer created as local description. | |
Grab the CALLER's local description. | |
Initiate CALLEE. | |
CALLEE - Set the CALLER's local description as remote description. | |
CALLEE - Create an answer offer. | |
CALLEE - Set the answer offer created as local description. | |
Grab the CALLEE's local description. |
This file contains 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
// @experimentalDecorators | |
let isAuthenticated = false; | |
function authenticate() { | |
return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) { | |
const handler = descriptor.value | |
descriptor.value = (...args: any[]) => { | |
if(isAuthenticated) return handler(...args) | |
const value = prompt("login required") |
NewerOlder