const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:8272,currentPage:1,targetPage:1,total:25,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[{id:17,url:'/t/327878556a045c76677716150f0d',name:'Apple',color:'#66BB6A',icon:'mdi-apple',},],posts:[{id:107401,num:0,uid:8844,content:'目前用 Piezo 录微信时要么只能录本地麦克风,对方的声音录制不到(不知是否和我用有线耳机接听有关),总之不太稳定。\u003Cbr\u003E希望不管是先来电还是先启动软件,总能妥善录下来。\u003Cbr\u003E十几年前帖子推荐的 wiretap 停止更新了,下载不到。https://www.v2ex.com/t/30212\u003Cbr\u003E请大佬多推荐。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 00:43:47',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107402,num:1,uid:18155,content:'OBS 肯定都可以录,但是会比较麻烦。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 04:21:47',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107403,num:2,uid:782,content:'对方声音录不到是因为没有录电脑的声音,我用 CleanShotX ,截图录屏都没问题,但是是付费软件。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 07:38:42',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107404,num:3,uid:9392,content:'好用的录音软件 https://github.com/audacity/audacity\u003Cbr\u003E好用的音频路由 https://rogueamoeba.com/loopback/',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 07:49:37',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107405,num:4,uid:2799,content:'blackhole + QuickTime\u003Cbr\u003EQuickTime 自身就能录屏和录音。blackhole 可以把所用输入输出都转到一个资源,输出给 QuickTime',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:37:47',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107406,num:5,uid:14391,content:'我开发一个软件, 支持录音, 但可能录制电话还有点问题, 我很有兴趣支持这个功能, 方便的话, 欢迎加我微信讨论. 微信可通过网站的 \u0026#34;交个朋友\u0026#34; 找到我, 感谢. \u003Cbr\u003Ehttps://www.engineerdraft.com/bemyears/',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:42:43',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107407,num:6,uid:2401,content:'苹果已经针对 macOS 的录屏开发了 ScreenCaptureKit 的 API ,现在录屏不再需要第三方的软件来录制系统内部的声音,quickrecorder 这个应用非常的好用',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 08:49:08',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107408,num:7,uid:2760,content:'Quickrecorder 可以试试',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 10:18:37',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107409,num:8,uid:8844,content:'感谢推荐,audacity 我看了界面和介绍是不是比较专业哇,界面看起来有点复杂,如果我只想基本实现好用的录音是否有更好的推荐?\u003Cbr\u003Eloopback 和 piezo 是同家公司出品,我看了介绍好几遍,不太清楚这个软件应用的场景?可以介绍下什么情景下需要这个软件吗?也许某一天我会需要。\u003Cbr\u003E谢谢你的耐心。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 11:17:56',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107410,num:9,uid:8844,content:'哇,开发者呀,之前站里看到你回复别人推荐声音翻译软件? bemyears ,已经收藏了,软件开发背后故事是帮助你的听力异常的同事吧,真暖心。\u003Cbr\u003E我并非 IT 人士,也很难描述出合理的需求,就是希望不管是先来电话还是微信电话,再点开录音设备软件或者反过来先运行软件,最终都能很好的将声音录下来就行。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 11:23:42',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107411,num:10,uid:8844,content:'\u003Cbr\u003E\u003Cbr\u003E\u003Cbr\u003E我有在用 CleanShot X ,只是觉得声音录制应该用专用软件可能体验会更好。感谢推荐。\u003Cbr\u003E@noisay',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 11:26:17',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107412,num:11,uid:8844,content:'我有在用,不过觉得声音录制用专用软件会更好用吧。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 11:27:07',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107413,num:12,uid:9392,content:'你基本录音用 piezo 就很好了,录制不到对方的声音是因为录音软件只收录了麦克风的音频流,loopback 可以把不同的音频流汇聚到一起成为一条新的音频流,然后让录音软件录制这个新音频流就可以。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 12:10:33',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107414,num:13,uid:4539,content:'audio hijack ?',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 12:21:04',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107415,num:14,uid:9392,content:'还有一种情况,比如你想在语音通话的时候和对方一起听歌,一般通话软件默认只采集麦克风的声音,用耳机听歌对方是听不到的,用外放的话大概率也会被降噪掉。这时候就可以用 Loopback 把麦克风和音乐软件的声音合并成新音频流,直接送到语音软件里',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 12:23:48',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107416,num:15,uid:8844,content:'哇,原来是这样功能哦,我来研究下。多谢分享。\u003Cbr\u003E铜板送给你我的朋友,你才是真正的英雄。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 13:41:23',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107417,num:16,uid:8844,content:'大佬,我用这样默认流程后,录音的文件听到对面的声音有一前一后一大一小回音,请问应该怎么设置才正确?如果 channels 放在主节点,会导致录音文件没有我自己的声音。如果关闭 channel ,会导致通话播放的当时有一大一小回音。\u003Cbr\u003Eblob:https://imgur.com/f53d8b76-f286-4668-a71b-b638247cabdc',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 14:02:28',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107418,num:17,uid:8844,content:'\u003Cimg src\u003D\"https://i.imgur.com/Dq2CPWz.png\"\u003E',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 14:02:59',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[19,],mentionUsers:[],likeUsers:[],},{id:107419,num:18,uid:9392,content:' 你这个图是 audiohijack 吧? 我没买它(没用过)帮不上忙 不好意思',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 14:21:30',updatedAt:'2025-04-16 23:08:26',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:107420,num:19,uid:15616,content:'#17 这个图做得好好,可以问问佬是用的什么软件吗',ipRegion:'',updatedByUid:0,createdAt:'2025-04-14 15:32:12',updatedAt:'2025-04-16 23:08:26',mentionNum:17,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[8844,{uid:8844,url:'/u/341b660c6a045c7f686e526f1907247e',avatar:'/a/341b660c6a045c7f686e526f1907247e',username:'ly1878🤖',}],[4539,{uid:4539,url:'/u/0a3a7e056a045c7365695f6f47266112',avatar:'/a/0a3a7e056a045c7365695f6f47266112',username:'septemfj🤖',}],[15616,{uid:15616,url:'/u/6a28475c6a045d72666b506f102c357e',avatar:'/a/6a28475c6a045d72666b506f102c357e',username:'lingcongdesu🤖',}],[782,{uid:782,url:'/u/3c2d79386a045c776762546f1b06347f',avatar:'/a/3c2d79386a045c776762546f1b06347f',username:'realkingsk🤖',}],[14391,{uid:14391,url:'/u/1d1c760e6a045d736363576f12052536',avatar:'/a/1d1c760e6a045d736363576f12052536',username:'ivyliner🤖',}],[9392,{uid:9392,url:'/u/361f7a2a6a045c7e6363546f34513175',avatar:'/a/361f7a2a6a045c7e6363546f34513175',username:'baichi🤖',}],[18155,{uid:18155,url:'/u/360063076a045d7f616f536f47026075',avatar:'/a/360063076a045d7f616f536f47026075',username:'LK99🤖',}],[2799,{uid:2799,url:'/u/38707d296a045c7567635f6f060b2b76',avatar:'/a/38707d296a045c7567635f6f060b2b76',username:'acorngyl🤖',}],[2760,{uid:2760,url:'/u/2d1c0b0b6a045c75676c566f3f023c02',avatar:'/a/2d1c0b0b6a045c75676c566f3f023c02',username:'noisay🤖',}],[2401,{uid:2401,url:'/u/6c06742b6a045c75646a576f3a22000f',avatar:'/a/6c06742b6a045c75646a576f3a22000f',username:'sjqboss🤖',}],]),related:[{title:'mac mini m4 32G 扩容到 2T,能当黑奴部署 sd 或 flux 么',url:'/d/203e71236a045c77606a567a445c616a03040937',},{title:'pdd macmini 2979 了,忍不住还是下单了',url:'/d/293a610b6a045c77606a567a4458606a1b706767',},{title:'Spotlight 图标竟然穿模了, macOS 15 越来越不苹果了',url:'/d/0c0a54216a045c77606a567a455c676a38082b3d',},{title:'MacOS 15.4 休眠 Bug:休眠后以太网会断开连接, Wi-Fi 不会',url:'/d/360a785e6a045c77606a567a465a646a2b2f6b2b',},{title:'mac mini pro 64 和 mac studio',url:'/d/000443266a045c77606a56754e58626a5e266611',},{title:'刚买的 mba m4,试用 crossover 玩玩暗黑 2,黑屏啊',url:'/d/3d7a45266a045c77606a56754f506a6a2f240660',},{title:'京东 19199 买 MBP M4pro 14 核 48G 1T 国家补贴+教育优惠',url:'/d/227a745e6a045c77606a56754f50666a5934253d',},{title:'Macmini M4 是否继续使用。',url:'/d/3b1b540e6a045c77606a56754f5f656a08101d65',},{title:'诡异! Enter 键自动唤醒 apple music 并自动播放',url:'/d/2071601d6a045c77606a56754f5a626a04002663',},{title:'IOS 18.4 safari 发热严重',url:'/d/121366206a045c77606a5675425c626a0d280366',},{title:'IOS 18.4 中文 intelligence 大家有啥想吐槽的么(非国行机)',url:'/d/380854296a045c77606a5675425a626a34731a2a',},{title:'macos Sequoia 15.4 中 chronod 一直占用 100%+ CPU',url:'/d/3b7c73236a045c77606a56754350646a58202b1f',},{title:'intel 的 mac 远程连接 m 芯片 mac 最佳姿势是什么?',url:'/d/2f08582f6a045c77606a5675435e656a29252322',},{title:'M1 iPad pro 耗电惊人',url:'/d/353b470e6a045c77606a5675435e606a25171411',},{title:'苹果这次 iOS 18.4 只有中国国内更新了 5G-A 吗?',url:'/d/09277c096a045c77606a5675435f656a3d283d1d',},{title:'日经贴:推荐个 mac 下适用的机械键盘',url:'/d/3f3978016a045c77606a5675435f666a030f042a',},{title:'MacBook 的 AC+ 是不是只有意外险的作用,并没有延长保修?',url:'/d/387c475e6a045c77606a5675435c666a272c3f17',},{title:'iPhone 的 Apple Intelligence 需要下载多久?',url:'/d/1b2f48196a045c77606a5675435a636a02731d1e',},{title:'mac mini 放办公室摸鱼怎么样?',url:'/d/68395e0b6a045c77606a56754359646a182a241e',},{title:'macOS 15.4 稳定出现一个大 bug',url:'/d/3b0e5b1b6a045c77606a567544506b6a08112708',},],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")