labvanced logoLabVanced
Contact
    • Remote Physiological Measurements
    • Eye Tracking
    • Head & Face-Tracking
    • Emotion Detection
    • Heart Rate Detection (rPPG)
    • Generative AI
    • Audio Transcription
    • EEG & Hardware Integrations
    • Decision Making
    • Reaction Times
    • Keyboard Inputs
    • Mouse Tracking
    • Mobile / Touch
    • Questionnaires
    • Gamepad / Joystick Integration
    • Audio Recordings
    • Audio Transcription
    • Video Recordings
    • Screen Recordings
    • Photos / Snapshots
    • Video Conferencing
    • Canvas Drawings
    • Build with AI
    • Build with Spreadsheets
    • Using the Experiment Editor
    • Coding
    • Creating Questionnaires
    • Balancing & Randomization
    • UX & Website Testing
    • Single Session Studies
    • Factorial Designs
    • Longitudinal & Multi-session Studies
    • Individual & Case Studies
    • Real-time Multi-user Studies
    • Interviews & Video Calls
    • Surveys & Questionnaires
    • Experience Sampling & Diaries
    • Classroom & Group Testing
    • Interventions & Clinical Trials
    • In the Browser
    • Mobile App
    • Desktop App
    • WebBridge Chrome Extension
    • Stroop Test
    • Flanker Task
    • N-back Task
    • Implicit Association Test
    • Trail Making Test
    • Digit Span
    • Corsi Block Tapping
    • Tower of London
    • Balloon Analog Risk Task
    • Preferential Looking
    • Browse more →
    • DASS-21
    • GAD-7
    • Rosenberg Self-Esteem Scale
    • PHQ-9
    • Ten-Item Personality Inventory
    • Big Five Personality Test
    • Adult ADHD Self-Report Scale
    • Browse more →
    • Building a Multi-user Study
    • Webcam Eye Tracking with AOIs
    • Website Frame Eye Tracking
    • Conditional Eye Tracking Opt-in
    • ChatGPT Study
    • Desktop App Study with EEG
    • Between-subjects Group Balancing
    • Building a Reading Study
    • Stroop Task
    • Lexical Decision Task
    • Browse more →
    Public Experiment Library
    • Arts Research
    • Clinical Psychology & Neuropsychology Medicine
    • Cognitive Psychology
    • Developmental Psychology
    • Behavioral Economics & Decision Science
    • Educational Research & Psychology
    • HCI & Human Factors
    • Linguistics & Language Sciences
    • Consumer & Marketing Research
    • Social & Personality Psychology
    • Sport & Movement Science
    • UX & Website Testing
    • Executive Functions
    • Language & Reading
    • Decision-Making & Reasoning
    • Attention
    • Overview
    • HCI & Human Factors
    • UX & Website Testing
    • Consumer & Marketing Research
    • White-Label App
    • PageGazer
    • Webcam vs. Lab Eye Tracking in InfantsAnna Banki & Gabriela Markova
    • Eye Tracking for Influencer MarketingDr. Alexander Edeling
    • Eye Tracking Infant Word ComprehensionDr. Giulia Calignano
    • Sentence Reading and Grammar JudgmentsDr. Jonathan Mirault
    • Regulating Emotions with MusicDr. Katrin Starcke
    • Game-Based Grammar Learning in ChildrenDr. Mireia Marimon
    • Gaze Cueing and AutismMax Soares Miehstein
    • Personality and Hearing in NoiseDr. Malte Wöstmann
    • All interviews →
    • Lab Notes
    • How to Cite Labvanced
    • Labvanced Platform Paper (2017)
    • Webcam Eye Tracking Validation (2024)
    • Webcam Eye Tracking Studies
    • Cognitive Psychology Studies
    • Developmental Psychology Studies
    • Linguistics Studies
    • See all publications →
    • Getting Started
    • Guide
    • Video Tutorials
    • Walkthroughs
    • Live Chat
    • Webinars & Onboarding Calls
    • AI Assistant
    • FAQ
    • Importing Templates Guide
    • Test Templates
    • Live Eye Tracking Metrics
    • Mouse Tracking Demo
    • ChatGPT Demo
    • Audio Recording Object Demo
    • Adding Image Stimuli Demo
    • Score & Feedback Demo
    • Browse all technical demos →
    • Timing Precision
    • Stimuli Presentation
    • Headphone Checks
    • Bot Checks
    • Participant Management
    • Comparisons
    • Research Blog
    • Prolific Integration
    • CloudResearch Integration
    • Sona Systems Integration
    • BeSample Integration
    • Panelabs Integration
    • Clickworker Integration
    • Labvanced Webhook API
    • Labvanced REST API
    • About Us
    • Newsletter Archive
    • Terms & Conditions
    • Data Security & Data Privacy
    • Technical & Organisational Measures
    • Accessibility
    • W-8BEN-E Form
    • Data Processing Agreement Template
    LinkedInYouTubeDiscord
    • Individual
    • Lab
    • Department / Consortium
    • Teaching
    • Campus
    • Commercial
    • Browse recording top-ups →
    • Browse AI token top-ups →
    • Overview
    • Study Building
    • Subject Recruitment
    • Dedicated Support
    Checkout
  • Contact
    • ZH
      • 中國人
      • Deutsch
      • Français
      • Español
      • English
      • 日本語
    • Logout
    • Loginlogin icon
    Platform
    Labvanced makes it easy to implement the most advanced study design and reliably collect your data.
    Biosignals & AI
    Remote Physiological MeasurementsEye TrackingHead & Face-TrackingEmotion DetectionHeart Rate Detection (rPPG)Generative AIAudio TranscriptionEEG & Hardware Integrations
    Behavioral Recordings
    Decision MakingReaction TimesKeyboard InputsMouse TrackingMobile / TouchQuestionnairesGamepad / Joystick Integration
    Media Recordings
    Audio RecordingsAudio TranscriptionVideo RecordingsScreen RecordingsPhotos / SnapshotsVideo ConferencingCanvas Drawings
    Implementation Techniques
    Build with AIBuild with SpreadsheetsUsing the Experiment EditorCodingCreating QuestionnairesBalancing & RandomizationUX & Website Testing
    Study Formats

    Your study can take whatever format your research needs. Here are a few popular examples.

    Single Session StudiesFactorial DesignsLongitudinal & Multi-session StudiesIndividual & Case StudiesReal-time Multi-user StudiesInterviews & Video CallsSurveys & QuestionnairesExperience Sampling & DiariesClassroom & Group TestingInterventions & Clinical Trials
    Where Studies Run

    Run your study online in the browser, on mobile or tablet with the mobile app, or in-lab with the desktop app.

    In the BrowserMobile AppDesktop AppWebBridge Chrome Extension
    Tests
    Explore cognitive tests, questionnaires, walkthroughs, and our public experiment library: a starting point for your next study.
    Popular Cognitive Tests
    Stroop TestFlanker TaskN-back TaskImplicit Association TestTrail Making TestDigit SpanCorsi Block TappingTower of LondonBalloon Analog Risk TaskPreferential Looking
    Browse more →
    Questionnaires & Scales
    DASS-21GAD-7Rosenberg Self-Esteem ScalePHQ-9Ten-Item Personality InventoryBig Five Personality TestAdult ADHD Self-Report Scale
    Browse more →
    Public Experiment Library

    Take a look at what other researchers in the community are doing through our extensive, open catalog of shared studies.

    Open the public library →
    Walkthroughs

    Step-by-step builds of complete studies, from a blank project to a running experiment, that you can follow along or adapt.

    Building a Multi-user StudyWebcam Eye Tracking with AOIsWebsite Frame Eye TrackingConditional Eye Tracking Opt-inChatGPT StudyDesktop App Study with EEGBetween-subjects Group BalancingBuilding a Reading StudyStroop TaskLexical Decision Task
    Browse more →
    Research
    One platform for students, academics, and industry researchers studying human behavior.
    Harvard UniversityStanford UniversityCambridge UniversityUCLNYUMax Planck InstituteUCLATU Munich

    Trusted by researchers at 1,500+ universities worldwide

    Academic Research
    Arts ResearchClinical Psychology & Neuropsychology MedicineCognitive PsychologyDevelopmental PsychologyBehavioral Economics & Decision ScienceEducational Research & PsychologyHCI & Human FactorsLinguistics & Language SciencesConsumer & Marketing ResearchSocial & Personality PsychologySport & Movement ScienceUX & Website Testing
    Research Areas
    Executive FunctionsLanguage & ReadingDecision-Making & ReasoningAttention
    Industry / Commercial
    OverviewHCI & Human FactorsUX & Website TestingConsumer & Marketing ResearchWhite-Label AppPageGazer
    Researcher Interviews

    Conversations with researchers about the studies they ran with Labvanced, what worked, and what they learned.

    Webcam vs. Lab Eye Tracking in InfantsAnna Banki & Gabriela MarkovaEye Tracking for Influencer MarketingDr. Alexander EdelingEye Tracking Infant Word ComprehensionDr. Giulia CalignanoSentence Reading and Grammar JudgmentsDr. Jonathan MiraultRegulating Emotions with MusicDr. Katrin StarckeGame-Based Grammar Learning in ChildrenDr. Mireia MarimonGaze Cueing and AutismMax Soares MiehsteinPersonality and Hearing in NoiseDr. Malte Wöstmann
    All interviews →
    Our Research
    Lab NotesHow to Cite Labvanced
    Peer Reviewed Studies

    A selection of peer-reviewed work built on Labvanced: our own platform and validation papers, and studies by the research community grouped by area. Hundreds more are listed on the full publications page.

    Labvanced Platform Paper (2017)Webcam Eye Tracking Validation (2024)Webcam Eye Tracking StudiesCognitive Psychology StudiesDevelopmental Psychology StudiesLinguistics Studies
    See all publications →
    Resources
    Valuable resources to help you learn the platform, stay updated, and more.
    Documentation
    Getting StartedGuideVideo TutorialsWalkthroughs
    Support
    Live ChatWebinars & Onboarding CallsAI AssistantFAQ
    Templates & Demos

    These are a few popular examples. Browse our guide and a selection of technical demos to get started with implementation.

    Importing Templates GuideTest TemplatesLive Eye Tracking MetricsMouse Tracking DemoChatGPT DemoAudio Recording Object DemoAdding Image Stimuli DemoScore & Feedback Demo
    Browse all technical demos →
    Methodology
    Timing PrecisionStimuli PresentationHeadphone ChecksBot ChecksParticipant ManagementComparisonsResearch Blog
    Integrations & APIs
    Prolific IntegrationCloudResearch IntegrationSona Systems IntegrationBeSample IntegrationPanelabs IntegrationClickworker IntegrationLabvanced Webhook APILabvanced REST API
    Company & Legal
    About UsNewsletter ArchiveTerms & ConditionsData Security & Data PrivacyTechnical & Organisational MeasuresAccessibilityW-8BEN-E FormData Processing Agreement Template
    LinkedInYouTubeDiscord
    Pricing
    Our licenses and additional services at a glance.
    Licenses
    IndividualLabDepartment / ConsortiumTeachingCampusCommercial
    Top-Ups

    Need more recordings for your lab or your own research? Simply use one of these recording top-up packages.

    Browse recording top-ups →

    Need more AI tokens for the AI assistant and study translations? Simply use one of these AI token top-up packages.

    Browse AI token top-ups →
    Additional Services

    Hire Labvanced’s expert team to quickly bring your project to the level of rigor it needs.

    OverviewStudy BuildingSubject RecruitmentDedicated Support
    Checkout

    Ready to purchase a license or top-up? Head straight to checkout.

    Go to checkout →
    • 中國人
    • Deutsch
    • Français
    • Español
    • English
    • 日本語
    • 入门
    • 指南
      • 入门

        • 任务编辑器
        • 框架
          • 画布框架
          • 页面框架
          • 网站框架
          • 溢出层与对话框 | Labvanced
        • 试验时间线
        • 刺激呈现
        • 反应的正确性
        • 对象
        • 事件
        • 变量
        • 任务向导
        • AI助手
        • 试验系统
        • 实验设计
          • 创建研究
          • 在 Labvanced 中导入模板
          • 数据框模式
          • 多用户实验设计
          • 纵向实验设计
      • 特色主题

        • 随机化与平衡
        • 眼动追踪
          • 在眼动追踪任务中呈现刺激
          • 如何选择眼动追踪校准设置
          • 在任务中设置眼动追踪
          • 记录和导出注视数据
          • 使用形状作为兴趣区域 (AOI) 进行眼动跟踪
          • 参与者校准体验
        • 网络桥接
          • 选择网站 AOI | 锚点、调整和验证 AOI 跟踪
          • 在网站区域(AOI)上跟踪鼠标行为 | Web Bridge指南
        • 问卷
        • 桌面应用
        • 示例研究
        • 参与者招募
        • API访问
          • REST API
          • Webhook API
          • WebSocket API
        • 其他主题

          • 精确的刺激时间
          • 多用户研究
          • 头部追踪在 Labvanced 中 | 指南
      • 主应用标签

        • 概览:主标签
        • 仪表板
        • 我的研究
        • 共享研究
        • 我的文件
        • 实验库
        • 我的账户
        • 许可证与服务
      • 研究标签

        • 概览:研究特定标签
        • 研究设计
          • 任务
          • 区块
          • 会话
          • 组
        • 任务编辑器
          • 任务控制
          • 试验系统
          • 框架类型
          • 对象
          • 对象属性表
          • 变量
          • 系统变量表
          • 事件系统
          • 文本编辑器功能
          • 任务编辑器中的眼动追踪选项
          • 任务中的头部追踪
          • 多用户研究
        • 设置
        • 变量
        • 媒体
        • 文本与翻译
        • 启动与参与
        • 受试者管理
        • 数据视图和导出
    • 视频教程
      • 视频概述
      • 在 Labvanced 中入门
      • 创建任务
      • 元素视频
      • 事件与变量
      • 高级主题
    • 演练
      • 介绍
      • 斯特鲁普任务
      • 词汇决策任务
      • 波斯纳注视提示任务
      • 注意盲点闪烁范式
      • 眼动追踪示例研究
      • 婴儿眼动追踪研究
      • 使用鼠标追踪的注意捕获研究
      • 快速串行视觉呈现
      • ChatGPT 研究
      • 眼动追踪演示:将 SVG 作为关注区域
      • 多用户演示:显示参与者的光标
      • 游戏手柄/操纵杆控制器 - 基本设置
      • 带有 EEG 集成的桌面应用研究
      • 被试间组平衡和变量设置
      • 构建多用户研究
      • 网站框架眼动追踪演练
      • 条件网络摄像头眼动追踪
      • 文本分段研究构建
      • 构建一个与 AI 的研究
    • 常见问题
      • 功能
      • 支持政策与指南
      • 安全与数据隐私
      • 许可
      • Labvanced 的精确度
      • 编程使用与 API
      • 离线使用 Labvanced
      • 故障排除
      • 研究创建问题
    Websocket 触发器接收来自外部设备的消息在 Labvanced 中

    Websocket 触发器

    当您的运行实验通过其 WebSocket 连接接收到消息时,Websocket Trigger 被触发。它允许本地脚本、录音设备或外部服务器在浏览器外部发生事件时启动您实验中的事件。

    目录

    • 概述
    • 工作原理
    • 触发器特定值
    • 工作流程提示
    • 研究与示例场景

    概述

    Websocket Trigger 在触发器选择菜单的 API/External Trigger 类别下列出。结合 发送到 Websocket 动作,它使实验与运行在 Labvanced 外部的软件实现双向通信。

    常见用例

    Websocket Trigger 在实验外部的信号需要改变实验中发生的事情时会被使用。

    • 接收 LSL 标记: 本地 Python 脚本将来自其他 Lab Streaming Layer 设备的标记传递到实验中,以便实验可以将其记录在自己的时间戳旁边。请参阅 EEG 和硬件集成 以获得完整的图景。
    • 闭环和生物反馈设计: 处理生理信号的脚本在超过某个阈值时发送消息,实验根据该消息改变刺激。
    • 外部处理: 服务器分析从实验发送的数据并返回结果,例如分类或分数,然后实验将其显示或记录。

    工作原理

    要访问 Websocket Trigger,请在任务编辑器中打开 事件系统 并创建一个新事件。在 API/External Trigger 类别下,选择 Websocket Trigger。

    在触发器可以使用之前,请在实验设置中启用连接:

    1. 打开 Settings 标签。
    2. 打开 Special Features 下拉菜单并找到 Websocket Connection 部分。
    3. 勾选启用该选项,然后输入 WebSocket Address 和 Port。默认值为 ws://localhost 和 8081,它们连接到与实验在同一台计算机上运行的脚本。

    该对话框包含以下内容:

    选项描述
    Websocket Address显示您实验设置中的地址。这里无法编辑。
    Port显示您实验设置中的端口。这里无法编辑。
    trigger / message触发此事件的消息标签。当传入消息的标签与该文本完全匹配时,触发器将被触发。输入 any 以在每条传入消息上触发。

    当实验开始时,Labvanced 会打开到您输入的地址和端口的连接。如果在设置中未启用连接,则不会打开连接,并且触发器永远不会触发。

    触发器仅在包含事件的框架显示时监听。在显示其他框架时到达的消息不会启动此事件。请将事件放在每个实验需要对消息作出反应的框架上。

    使用 any 的事件将在每条消息上触发。如果同一框架上的另一个事件使用特定标签,则在带有该标签的消息到达时,两个事件都会触发。

    发送程序提供的内容

    只有当 Labvanced 以外的程序向其发送消息时,触发器才会触发。该程序通常是同一台计算机上的一个短脚本,运行着实验所连接的 WebSocket 服务器。它发送的每条消息有两个部分:

    • 标签: 触发器将其与 trigger / message 字段进行比较。当它们匹配时,事件会被触发,并且该标签作为 Message 值可用。
    • 内容: 脚本希望传递的任何值,例如标记值或测量。它作为 Data 值可用。

    对于编写脚本的人来说,每条消息都是带有 msg 字段(用于标签)和 value 字段(用于内容)的 JSON 对象。 Labvanced WebSocket API GitHub 仓库 中的示例脚本以这种方式发送和接收 LSL 标记,是一个很好的起点。有关连接设置,请参见 WebSocket API 指南。

    触发器特定值

    触发器触发后,以下值将在事件的操作中可用。通过 Trigger (Websocket Trigger) 下的 值选择菜单 选择它们。

    值描述
    Message接收到的消息的标签。使用它区分消息类型,尤其是在使用 any 的事件中。
    Data接收到的消息的内容。它可以保存任何 JSON 值,例如数字、字符串或列表,并且可以使用 设置 / 记录变量动作 存储在变量中。
    Trigger Timestamp (Unixtime)触发器触发的时间,以 Unix 时间戳表示,包含毫秒。
    Trigger Time (From Frame Onset)从框架开始到触发器触发的时间,单位为毫秒。

    工作流程提示

    • 在开始实验之前先启动您的脚本。当实验开始时,连接会被打开。
    • 在与脚本运行在同一计算机上的实验一起运行时测试连接,然后再收集数据。默认 ws://localhost 仅能到达该计算机上的程序。
    • 保持消息标签简短且在脚本和实验之间一致。匹配是精确的,因此 Marker 和 marker 是不同的消息。
    • 在消息的时间对于分析很重要的情况下,一起记录 Trigger Time (From Frame Onset) 和 Data。

    研究与示例场景

    接收来自其他设备的标记。 在 LSL 接收标记 库实验中,由外部设备生成的标记通过一个本地 Python 脚本到达,脚本通过 Websocket Trigger 将它传递到实验中。实验然后记录标记值。使用库中的 Inspect 选项查看事件设置。

    双向消息传递。 Socket 连接示例 库实验通过发送到 Websocket 动作向外发送消息,并通过此触发器对回复做出反应。

    进一步阅读

    发送到 Websocket 动作

    发送到 Websocket 动作

    将消息或变量发送出实验的配对动作。

    WebSocket API

    WebSocket API

    如何将实验连接到本地脚本或外部服务器。

    值选择菜单

    值选择菜单

    如何在您的动作中引用触发器特定值。

    事件概述

    事件概述

    Labvanced 中触发器和动作逻辑系统的完整介绍。