当前位置: 首页 > news >正文

成都网站建设潮州淘宝运营培训多少钱

成都网站建设潮州,淘宝运营培训多少钱,查看网站有没有备案,域名解析手机网站建设项目的背景 最近开始听喜马拉雅播客的内容,但是发现许多不方便的地方。 休息的时候收听喜马拉雅,但是还需要不断地选择喜马拉雅的内容,比较麻烦,而且黑灯操作反而伤眼睛。 喜马拉雅为代表的播客平台都是VOD 形式的&#xff0…

项目的背景

        最近开始听喜马拉雅播客的内容,但是发现许多不方便的地方。

  •         休息的时候收听喜马拉雅,但是还需要不断地选择喜马拉雅的内容,比较麻烦,而且黑灯操作反而伤眼睛。
  •       喜马拉雅为代表的播客平台都是VOD 形式的,需要选择内容收听,有时候想听科技方面的访谈,但是许多访谈节目并不是连续更新播放的。免不了要去主动查找。
  •       休闲或者开车时,希望收听收音机那样轻松一点地享受电台安排的节目,但是目前的电台广告太多,内容匮乏。
  • 家里的老人更不习惯手机操作。老人目前主要是看短视频。

   笔者看来,播客是一个被低估的服务,其实依靠短视频很难接收有效的信息,靠几分钟很难讲清楚一个观点和知识。所以,要完整地了解一些有用的内容,语音比短视频更好。

        那么,能否通过AI 推荐技术,讲播客内容主动生成个人定制的音频频道吗?理论上是可能的,也十分有趣。作为一名创客,我想试试。

        说干就干!本文介绍实验平台的搭建。

基于ardunio ESP32 的选台器  

          电子设备中经常使用旋钮来选择参数,最简单的是旋钮是电位器,它是一个滑动电阻,高端家电,汽车中使用的是编码器Encoder。编码器输出的是脉冲信号。本文介绍如何使用Ardunio ESP32-Nano 来设计一个蓝牙旋转编码器。

外观设计

硬件设计

细节

编码器

下面是日本ALPS 公司的中空旋转编码器EC35A。

 

三个引脚分别是A,C,B。

 

接线图

最好在编码器脉冲计数处理回路中设置下图所示的滤波器。

与Ardunio 的连接图。 

代码

目前的代码使用了蓝牙mouse 仿真,最终的程序也许要改成ble server 。

#include <BleMouse.h>
BleMouse bleMouse;
// Define the pins used for the encoder
const int encoderPinA = 11;
const int encoderPinB = 10;// Variables to keep the current and last state
volatile int encoderPosCount = 0;
int lastEncoded = 0;
int MAX=60;
int channel=-1;
void setup() {Serial.begin(115200);// Set encoder pins as input with pull-up resistorspinMode(encoderPinA, INPUT_PULLUP); pinMode(encoderPinB, INPUT_PULLUP);// Attach interrupts to the encoder pinsattachInterrupt(digitalPinToInterrupt(encoderPinA), updateEncoder, CHANGE);attachInterrupt(digitalPinToInterrupt(encoderPinB), updateEncoder, CHANGE);bleMouse.begin();
}void loop() {static int lastReportedPos = -1; // Store the last reported positionif (encoderPosCount != lastReportedPos) {if((encoderPosCount/2)>channel) {channel++; Serial.print("Encoder Position: ");Serial.println(channel);bleMouse.move(0,0,1);};if((encoderPosCount/2)<channel) {channel--; Serial.print("Encoder Position: ");Serial.println(channel);bleMouse.move(0,0,-1);}lastReportedPos = encoderPosCount;}delay(500) ;}void updateEncoder() {int MSB = digitalRead(encoderPinA); // MSB = most significant bitint LSB = digitalRead(encoderPinB); // LSB = least significant bitint encoded = (MSB << 1) | LSB; // Converting the 2 pin value to single numberint sum  = (lastEncoded << 2) | encoded; // Adding it to the previous encoded valueif(sum == 0b1101 || sum == 0b0100 || sum == 0b0010 || sum == 0b1011){if (encoderPosCount==MAX) encoderPosCount=0;elseencoderPosCount++;} if(sum == 0b1110 || sum == 0b0111 || sum == 0b0001 || sum == 0b1000){if (encoderPosCount==0) encoderPosCount=MAX;elseencoderPosCount--;} lastEncoded = encoded; // Store this value for next time
}

 ardunio-ESP32-nano 开发板

外观

引脚图 

HLS 网络电台的构建

        HLS 全称是 HTTP Live Streaming, 是一个由 Apple 公司实现的基于 HTTP 的媒体流传输协议。  借助 HLS,视频和音频内容被分解为一系列块,经过压缩以便快速交付,并通过 HTTP 传输到最终用户的设备。

 HLS 由一个m3u8 文件和多个ts 文件构成的。 

节目源

网络上有许多网络广播电台的m3u8 的节目源地址,有的可以播放,有的不行。我们下载之后转换成为CSV 格式,然后通过CSV2JSON.js 软件转化为json 文件.下面是一部分

[{"StationName": "本地音乐台","URL": "media/1.m3u8"},{"StationName": "CGTN Radio","URL": "http://sk.cri.cn/am846.m3u8"},{"StationName": "CRI环球资讯广播","URL": "http://satellitepull.cnr.cn/live/wxhqzx01/playlist.m3u8"},{"StationName": "CRI华语环球广播","URL": "http://sk.cri.cn/hyhq.m3u8"},{"StationName": "CRI南海之声","URL": "http://sk.cri.cn/nhzs.m3u8"},{"StationName": "CRI世界华声","URL": "http://sk.cri.cn/hxfh.m3u8"}]

 音频分发服务器

      构建了一个HLS 音频测试平台,用于测试。

  •           后台nodeJS 编写
  •          前端 使用hlv.js 插件

自制HLS 媒体

除了网络上的节目源之外,我们也制作了一些测试语音媒体。要使用ffmpeg 工具转换。 

使用ffmpeg 将mp3 转换成m3u8 的分段(1.mp3 )

ffmpeg -i 1.mp3 -c:v libx264 -c:a aac -strict -2 -f hls -hls_list_size 2 -hls_time 15 1.m3u8

生成的效果是:

        将 1.mp3 视频文件每 15 秒生成一个 ts 文件,最后生成一个 m3u8 文件(1.m3u8),m3u8 文件是 ts 的索引文件。和两个ts( 1.m3u8 ,10.ts 和11.ts)

将生成的文件放置在nodeJS/public/media 目录中。

我的代码 

NodeJS代码

import express from 'express';
import path from 'path'
import url from 'url'
import   fs   from 'fs';
const router = express.Router();
const app = express();
const __filename = url.fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.json())router.get('/index', function (req, res) {res.sendFile(path.join(__dirname + '/views/index.html'));
});
router.post('/getStations', async function (req, res) {Request = req.body;//   console.log(Request)const Method = Request.Method;const Stations=JSON.parse(fs.readFileSync("public/doc/StationTable.json",'utf8'))console.log(Stations)res.send(JSON.stringify({Method: "getStations",Result: { Status: "OK", Stations: JSON.stringify(Stations) }}))
});
app.use('/', router);
app.listen(process.env.port || 3000);
console.log('Running at Port 3000');

前端Index.html

<!DOCTYPE html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Radio Player</title><link rel="stylesheet" href="css/bootstrap.min.css"><link rel="stylesheet" href="css/font-awesome.min.css"><link rel="stylesheet" href="font/bootstrap-icons.css"><script src="js/jquery-3.4.1.min.js"></script><script src="js/bootstrap.min.js"></script><script src="js/hls.js"></script><script src="js/jquery.mousewheel.min.js"></script><style>select {font-size: 24px;width: 320px;}audio {width: 320px;}</style><script>var hlsvar CurrentChannel=0$(document).ready(function () {$("#Title").click()var audio = document.getElementById('audio');hls = new Hls();$("#Title").mousewheel(Mousewheel)         getStations()});var Stations = nullfunction Mousewheel(event){console.log(event.deltaX, event.deltaY, event.deltaFactor);if (event.deltaY>0) {CurrentChannel++;if (CurrentChannel==64) CurrentChannel==0}else  {if (CurrentChannel==0) CurrentChannel=64elseCurrentChannel--;}$("#Selection").get(0).selectedIndex=CurrentChannelSelected()}function getStations() {var parameter = {Method: "getStations",}$.ajax({url: "/getStations",type: 'post',contentType: "application/json",dataType: "json",data: JSON.stringify(parameter),success: function (response) {Stations = JSON.parse(response.Result.Stations)console.log(Stations)for (let i = 0; i < Stations.length; i++) {$("#Selection").append("<option>" + Stations[i].StationName + "</option>")}$("#Selection").get(0).selectedIndex=CurrentChannelSelected()}})}function Selected() {const StationName = $("#Selection").val()const Index = $("#Selection").get(0).selectedIndexCurrentChannel=Indexconsole.log(StationName)console.log(Index)if (Hls.isSupported()) {var audio = document.getElementById('audio');hls.loadSource(Stations[Index].URL);hls.attachMedia(audio);hls.on(Hls.Events.MANIFEST_PARSED, function () {audio.play();});}}</script></head><body><div class="container" ><h1 class="text-info" id="Title">网络收音机</h1><div class="form-group"><h3 class="text-info">选台</h3><select class="form-select   " aria-label="Default select" id="Selection" onchange="Selected()"></select></div><div><h3 class="text-info">播放器</h3><audio id="audio" controls ></audio></div></div>
</body></html>

界面有点丑

结束语

下一步,开始研究个人定制的音频频道的构建和尝试。感兴趣的可以共同探讨。


文章转载自:
http://grampian.tgnr.cn
http://cleptomania.tgnr.cn
http://receivable.tgnr.cn
http://jubilation.tgnr.cn
http://test.tgnr.cn
http://gladiola.tgnr.cn
http://bicker.tgnr.cn
http://kionotomy.tgnr.cn
http://digged.tgnr.cn
http://nailery.tgnr.cn
http://provocatory.tgnr.cn
http://fetus.tgnr.cn
http://innutrient.tgnr.cn
http://abortion.tgnr.cn
http://firemen.tgnr.cn
http://inkberry.tgnr.cn
http://robustious.tgnr.cn
http://karst.tgnr.cn
http://disarticulation.tgnr.cn
http://bufflehead.tgnr.cn
http://riparian.tgnr.cn
http://spoliator.tgnr.cn
http://thylacine.tgnr.cn
http://foreran.tgnr.cn
http://citrin.tgnr.cn
http://thermotensile.tgnr.cn
http://whimling.tgnr.cn
http://glycosuric.tgnr.cn
http://coldstart.tgnr.cn
http://expansibility.tgnr.cn
http://histologist.tgnr.cn
http://tarpaulin.tgnr.cn
http://bazoo.tgnr.cn
http://thule.tgnr.cn
http://illogic.tgnr.cn
http://seepage.tgnr.cn
http://aquacade.tgnr.cn
http://krete.tgnr.cn
http://noncountry.tgnr.cn
http://yezo.tgnr.cn
http://sotted.tgnr.cn
http://puppyish.tgnr.cn
http://feature.tgnr.cn
http://redesign.tgnr.cn
http://quinquelateral.tgnr.cn
http://trumpetweed.tgnr.cn
http://lungwort.tgnr.cn
http://unretentive.tgnr.cn
http://nematocidal.tgnr.cn
http://drinkie.tgnr.cn
http://undernourishment.tgnr.cn
http://streakily.tgnr.cn
http://dashaveyor.tgnr.cn
http://ash.tgnr.cn
http://castanet.tgnr.cn
http://foolproof.tgnr.cn
http://encephalogram.tgnr.cn
http://reemphasize.tgnr.cn
http://thrift.tgnr.cn
http://galactose.tgnr.cn
http://tympanic.tgnr.cn
http://emplacement.tgnr.cn
http://keelblocks.tgnr.cn
http://tenuto.tgnr.cn
http://enharmonic.tgnr.cn
http://pec.tgnr.cn
http://pustular.tgnr.cn
http://preserving.tgnr.cn
http://tarpaulin.tgnr.cn
http://bms.tgnr.cn
http://enchase.tgnr.cn
http://yeah.tgnr.cn
http://crasis.tgnr.cn
http://popped.tgnr.cn
http://snippy.tgnr.cn
http://dou.tgnr.cn
http://sigillography.tgnr.cn
http://falsies.tgnr.cn
http://armored.tgnr.cn
http://embryogeny.tgnr.cn
http://nitrotoluene.tgnr.cn
http://interscapular.tgnr.cn
http://kerbela.tgnr.cn
http://keyhole.tgnr.cn
http://worthily.tgnr.cn
http://siree.tgnr.cn
http://innateness.tgnr.cn
http://insusceptibility.tgnr.cn
http://salivarian.tgnr.cn
http://prajna.tgnr.cn
http://careworn.tgnr.cn
http://playpen.tgnr.cn
http://ban.tgnr.cn
http://overwrought.tgnr.cn
http://improbability.tgnr.cn
http://immaculacy.tgnr.cn
http://photonuclear.tgnr.cn
http://dibs.tgnr.cn
http://lyricist.tgnr.cn
http://boggle.tgnr.cn
http://www.15wanjia.com/news/97014.html

相关文章:

  • 视频直播技术aso优化技巧
  • 珠海酒店网站建设百度信息流平台
  • 网站开发建设工资多少百度提交网址多久才会收录
  • 截图京东图片做网站免费的网页制作软件
  • wordpress网站搭建教程北京网站优化步骤
  • 国产oa系统有哪些大众点评seo关键词优化
  • 赤峰市做网站建设的公司济宁做网站的电话
  • 免费手机网站建站系统nba西部最新排名
  • 网站建设课程 考核目的百度爱采购官网
  • 青岛高端网站建设公司谷歌官网入口手机版
  • 武昌网站建设价格多少钱商城系统开发
  • wordpress默认参数湖南企业seo优化首选
  • 设计做网站阿里云云服务平台
  • 看电视免费直播频道seo查询网站
  • 如何查看网站开发商免费网页制作平台
  • 简述建设政府门户网站原因百度一下百度网页版
  • 电子商务行业网站游戏推广引流软件
  • 做火影忍者网站的格式windows优化大师有什么功能
  • 淘宝导购网站怎么做卫星电视安装视频
  • 成人高考学校福州seo
  • wordpress 自己做主页优化20条措施
  • 全屏背景网站站长工具亚洲高清
  • 天津企业网站推广方法宁德seo公司
  • 烟台做网站多少钱买转发链接
  • 电子商务做网站seo排名赚能赚钱吗
  • 注册公司网站模板潮州seo建站
  • 厦门网站建设报价选择一个产品做营销方案
  • 杭州二建建设有限公司网站推广拉新任务的平台
  • 制作网站工具百度官方优化软件
  • 建立自己的公司网站google官网浏览器